My app uses the Lucee ORM extension. It will run f...
# lucee
p
My app uses the Lucee ORM extension. It will run fine 99% of the time. Intermittently, it will through errors like "Association references unmapped class...". It runs on EKS so EKS will start up a new container to replace the container throwing the error. I haven't been able to find the issue. Again, it's difficult because the code runs (under load) 99% of the time. I just found there is an Ortus ORM Extension. Is that a "drop in replacement" for Lucee ORM? I guess I'll give that a shot but if anyone has any feedback about that that would be great.
q
I switched to using the Ortus ORM extension about a year ago. No issues. Cleared up a bunch of random bugs that existed. Bonus that it uses a much newer version of Hibernate, so it supports a few new things with the HQL engine, etc.
👍 1
I have about 8-10 pretty large apps running on it. I don't have anything on EKS, but I do deploy on ECS and Lightsail containers
p
cc @Marc Funaro
👍 1
z
Yes Lucee officially recommends it!
g
I havwe some issues using it - due to the newer version of hibernate and am currently still on the "Lucee" extension... so your mileage may vary.... lots of testing in your future!
p
I swapped in the Ortus ORM and now I'm getting
Copy code
class java.math.BigDecimal cannot be cast to class java.lang.Long (java.math.BigDecimal and java.lang.Long are in module java.base of loader 'bootstrap')..
I'm still trying to hone in on exactly where the hang up is but if anyone has hit this and can give a clue that would be great.
b
Prolly related to Lucee's change in Lucee 6 to use bigdecimals for all numbers
do you have a stack trace?
p
Copy code
lucee.runtime.exp.NativeException: class java.math.BigDecimal cannot be cast to class java.lang.Long (java.math.BigDecimal and java.lang.Long are in module java.base of loader 'bootstrap')
  at org.hibernate.type.descriptor.java.LongTypeDescriptor.unwrap(LongTypeDescriptor.java:19)
  at org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$1.doBind(BigIntTypeDescriptor.java:46)
  at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:73)
  at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:276)
  at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:271)
  at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:39)
  at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:3073)
  at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:3048)
  at org.hibernate.persister.entity.AbstractEntityPersister$2.bindValues(AbstractEntityPersister.java:3271)
  at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:42)
  at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3279)
  at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3914)
  at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:84)
  at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:645)
  at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:282)
  at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:263)
  at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:317)
  at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:329)
  at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:286)
  at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:192)
  at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
  at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:194)
  at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:179)
  at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:100)
  at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)
  at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
  at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:652)
  at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:645)
  at ortus.extension.orm.HibernateORMSession.save(HibernateORMSession.java:462)
  at ortus.extension.orm.functions.EntitySave.call(EntitySave.java:45)
  at ortus.extension.orm.functions.EntitySave.call(EntitySave.java:40)
  at ortus.extension.orm.functions.EntitySave.invoke(EntitySave.java:55)
  at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:40)
  at ormbaseclass_cfc$cf.udfCall(/ORMBaseClass.cfc:24)
  at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
  at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357)
  at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:715)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:588)
  at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2033)
  at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:796)
  at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1992)
  at index_cfm$cf.call(/index.cfm:25)
  at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1046)
  at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:940)
  at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:921)
  at application_cfc$cf.udfCall(/Application.cfc:120)
  at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
  at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357)
  at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:715)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:588)
  at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2033)
  at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:476)
  at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:212)
  at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41)
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2726)
  at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2713)
  at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2684)
  at lucee.runtime.engine.Request.exe(Request.java:45)
  at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1159)
  at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1116)
  at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
  at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:42)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
  at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:761)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:396)
  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:937)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
  at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
  at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
  at java.base/java.lang.Thread.run(Unknown Source)
 Caused by: java.lang.ClassCastException: class java.math.BigDecimal cannot be cast to class java.lang.Long (java.math.BigDecimal and java.lang.Long are in module java.base of loader 'bootstrap')
  ... 88 more
b
@philcruz Are you using a version of Lucee listed as having that fix?
Fix versions 6.2.0.84 6.1.1.85
p
ah, thanks for the related ticket. But I’m using 6.1.2.22 (well, I’m using this image
lucee/lucee:6.1.2.22-SNAPSHOT-light-nginx-tomcat9.0-jre21-temurin-jammy
) so it should be fixed?
b
Well, that's assuming the ticket is the exact same issue you're hitting
It's possible the fix for ticket LDEV-5086 doesn't cover your exact use case
Either way, I'm unclear if that error is an issue with the Ortus ORM extension or an issue with Lucee itself. Given the precedent of LDEV-5086, I'd assume the latter.
p
Yep. I’ll some things to help understand. Probably one quick thing is to use another image, like a 6.2. I can also run the reproducible code to see if it runs or not.
👀 1
z
if something ain't working and you are using an older version of lucee, I'd recommend always just going and try the latest version first, otherwise, you're just battling tech debt
👍 1
g
I ran into a similar bootstrap error issue and found that it involved a datatype mapping that ORM didn't like.
z
did i mention i'm a sick puppy and really love stacktraces? it's much easier to for us to help triage issues!