ORM double error with FW/1 while working fine on CF11

91 views
Skip to first unread message

Mehdi B

unread,
Apr 22, 2015, 2:06:14 PM4/22/15
to lu...@googlegroups.com
Hi guys,

Strange error I'm getting here.

Testing right now a FW/1 app that work fine on Coldfusion 11. Application use MySQL (db setup on 5.6). ORM is used for DB & while on Coldfusion everything looks working fine I get:

Lucee 4.5.1.003 Error (org.hibernate.MappingException)
MessageBad identifier type: double
Causeorg.hibernate.MappingException

Same testing on 4.5.0

Lucee 4.5.1.000 Error (org.hibernate.MappingException)
MessageBad identifier type: double
Causeorg.hibernate.MappingException
 

Same latest:

Lucee 4.5.1.011 Error (org.hibernate.MappingException)
MessageBad identifier type: double
Causeorg.hibernate.MappingException
 

This is exactly the same code and same datasource name used here. Even replaced mySQL drivers with Mysql 5.6 update Jdbc driver without any success.

If you can point for direction?

Servers on Windows/ Tomcat/ MySQL 5.6

Thanks

Julian Halliwell

unread,
Apr 22, 2015, 4:02:55 PM4/22/15
to lu...@googlegroups.com
Hi Mehdi

I encountered this error on Railo before it became Lucee. The solution
was to remove any type="numeric" attributes from the fieldtype="id"
property of my ORM entities.

So changing this:

property name="ID" fieldtype="id" type="numeric" generator="assigned"
unsavedValue="-1";

to this:

property name="ID" fieldtype="id" generator="assigned" unsavedValue="-1";

fixed the issue. If you need the type specified you can use:

ormType="int"

and that doesn't seem to cause a problem.

Cheers
Julian
http://cfsimplicity.com/

Mehdi B

unread,
Apr 22, 2015, 7:04:23 PM4/22/15
to lu...@googlegroups.com
Thanks that sounds intersting I will add the ormtype="int" as it was not defined. Seem CF11 survive without it while railo/lucee replace it with a double.

Will test and confirm solution.

Thanks again.

Julian Halliwell

unread,
Apr 23, 2015, 2:55:24 AM4/23/15
to lu...@googlegroups.com
Mehdi, the problem seems to be with the type="numeric"
attribute/value, not the lack of an ormType. I only suggested adding
the ormType if you still want to show the property type having removed
type="numeric".

On 23 April 2015 at 00:04, Mehdi B <mehdi....@gmail.com> wrote:
> Thanks that sounds intersting I will add the ormtype="int" as it was not
> defined. Seem CF11 survive without it while railo/lucee replace it with a
> double.
>

Michael Offner

unread,
Apr 23, 2015, 3:17:34 AM4/23/15
to lucee
can you please post the java stacktrace as well...

Micha

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/59fa70f0-5f38-49a7-9794-dac834c45359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mehdi B

unread,
Apr 23, 2015, 4:30:00 AM4/23/15
to lu...@googlegroups.com
Lucee 4.5.1.000 Error (org.hibernate.MappingException)
MessageBad identifier type: double
Causeorg.hibernate.MappingException
Java StacktraceBad identifier type: double 
  at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:95):95 
  at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67):67 
  at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:136):136 
  at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:475):475 
  at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:133):133 
  at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84):84 
  at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:297):297 
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385):1385 
  at lucee.runtime.orm.hibernate.SessionFactoryData.buildSessionFactory(Unknown Source):-1 
  at lucee.runtime.orm.hibernate.HibernateORMEngine.getSessionFactoryData(Unknown Source):-1 
  at lucee.runtime.orm.hibernate.HibernateORMEngine.init(Unknown Source):-1 
  at lucee.runtime.config.ConfigImpl.getORMEngine(Unknown Source):-1 
  at lucee.runtime.config.ConfigImpl.resetORMEngine(Unknown Source):-1 
  at lucee.runtime.orm.ORMUtil.resetEngine(Unknown Source):-1 
  at lucee.runtime.listener.ModernAppListener.initApplicationContext(Unknown Source):-1 
  at lucee.runtime.listener.ModernAppListener._onRequest(Unknown Source):-1 
  at lucee.runtime.listener.MixedAppListener.onRequest(Unknown Source):-1 
  at lucee.runtime.PageContextImpl.execute(Unknown Source):-1 
  at lucee.runtime.PageContextImpl.execute(Unknown Source):-1 
  at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(Unknown Source):-1 
  at lucee.loader.servlet.CFMLServlet.service(Unknown Source):-1 
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:727):727 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208 
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241):241 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208 
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220):220 
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122):122 
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504):504 
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170):170 
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103):103 
  at mod_cfml.core.invoke(core.java:132):132 
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950):950 
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116):116 
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421):421 
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074):1074 
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611):611 
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314):314 
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142 
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617 
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61 
  at java.lang.Thread.run(Thread.java:745):745 
 
Timestamp4/23/15 8:26:08 AM UTC



Current ORM for ID as this seem triggering the error:

property name="id" fieldtype="id" generator="native" notnull="true" default="0" unsavedvalue="0";

Works fine on CF11 on the same box/config/DB. It even triggered an errror as I run first the application on Lucee so it built up the DB with double type instead of int and I had to delete the DB and rebuild it with CF11 while lucee remain stuck with this error.

DB: Mysql 5.6 / and using default JDBC drivers and even updated it with MySQL own driver.

Do you need more input?

Mehdi

Michael Offner

unread,
Apr 23, 2015, 4:55:48 AM4/23/15
to lucee
can you raise a ticket, we will address it

Micha

Mehdi B

unread,
Apr 23, 2015, 5:43:22 AM4/23/15
to lu...@googlegroups.com

Mehdi B

unread,
Apr 23, 2015, 12:36:59 PM4/23/15
to lu...@googlegroups.com
Hi,

The problem relies in an ORM I found and as Julian pointed:

<cfproperty name="id" generator="native" type="numeric" fieldtype="id" unsavedvalue="-1" default="-1" hint="city id" >


This setup filed ID as double instead of INT

setting: 

<cfproperty name="id" generator="native" type="integer" fieldtype="id" unsavedvalue="-1" default="-1" hint="city id" >

Would offer a fix. But this worked fine in CF11 ?

Now fighting with another bug...

Mehdi

Sean Corfield

unread,
Apr 23, 2015, 12:40:41 PM4/23/15
to lu...@googlegroups.com
I believe the suggestion was to do this:

<cfproperty name="id" generator="native" type="numeric" ormType="integer" fieldtype="id" unsavedvalue="-1" default="-1" hint="city id" >

I’m actually surprised ACF allows you to omit ormType and still have this work correctly. I guess it does a less literal mapping to Hibernate.

Sean

Chip Pinkston

unread,
Apr 23, 2015, 12:54:31 PM4/23/15
to lu...@googlegroups.com
I ran into so similar issues when first moving to Railo.  I came across this good blog post by Bob Silverberg that ran down of the different 'types' that you can specify in CF ORM:


The following covers the different instances:
  • type - this is the standard type attribute that was available to the cfproperty tag pre-CF9. You are only supposed to use valid CF types for this.
  • ormtype - this is used to tell Hibernate what the data type of the property should be. It is a database agnostic value. Hibernate will translate it into a valid datatype for the dbms in question.
  • sqltype - this is a dbms-specific datatype. You would use this when you want to direct Hibernate to create a column with a specific datatype.
  • none - if you are pointing your persistent object at an existing table, you can choose not to specify any of the above three attributes, and Hibernate will look at the database to determine the datatype.

Hope this is helpful.

Julian Halliwell

unread,
Apr 23, 2015, 1:17:35 PM4/23/15
to lu...@googlegroups.com
As Chip points out (via Bob's blog), ormType isn't required by Lucee
or ACF if you are pointing to an existing table (as opposed to having
Hibernate generate it).

But it actually makes no difference to this bug, which seems to be
triggered by using the *combination* of type="numeric" (i.e. the CF
type) and "unsavedvalue".

I worked around it by removing type="numeric" and adding an ormType
just so that the type was still "documented", but Mehdi has found the
type="integer" will work ok with "unsavedvalue".

Mehdi B

unread,
Apr 23, 2015, 1:51:20 PM4/23/15
to lu...@googlegroups.com
It's an code and it worked perfectly fine on CF11, got the bite from lucee. 

defining the ORM using CFscript works already fine in other part of the code.

And seem Julian too run into this.

Thanks Chrip for the link.

Mehdi
Reply all
Reply to author
Forward
0 new messages