regression: ClassCastException with ortus hibernate extension on docker

Description

from slack https://cfml.slack.com/archives/C06TA0A9W/p1741801018906039

This is what I'm getting when running Lucee 6.1/6.2 via Docker + CommandBox. If I run natively, no such error. MacOs 15.4, Java Version: 21.0.6+7-LTS (Eclipse Adoptium) (edited)

interestingly repos via commandbox docker, but not with commandbox without docker

I’ve asked for a repo

Lucee 6.2.1.63-SNAPSHOT Error (java.lang.ClassCastException) Message class lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to class lucee.transformer.bytecode.statement.tag.TagComponent (lucee.transformer.bytecode.statement.ExpressionAsStatement and lucee.transformer.bytecode.statement.tag.TagComponent are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @7e7f0f0a) AI (Experimental) For AI-driven exception analysis setup, see AI Setup Guide. Java Stacktrace lucee.runtime.exp.NativeException: class lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to class lucee.transformer.bytecode.statement.tag.TagComponent (lucee.transformer.bytecode.statement.ExpressionAsStatement and lucee.transformer.bytecode.statement.tag.TagComponent are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @7e7f0f0a) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.componentStatement(AbstrCFMLScriptTransformer.java:493) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:247) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:222) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:205) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:189) at lucee.transformer.cfml.script.CFMLScriptTransformer.transform(CFMLScriptTransformer.java:48) at lucee.transformer.cfml.tag.CFMLTransformer.tag(CFMLTransformer.java:742) at lucee.transformer.cfml.tag.CFMLTransformer.body(CFMLTransformer.java:409) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:348) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:340) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:195) at lucee.runtime.compiler.CFMLCompilerImpl._compile(CFMLCompilerImpl.java:101) at lucee.runtime.compiler.CFMLCompilerImpl.compile(CFMLCompilerImpl.java:73) at lucee.runtime.PageSourceImpl._compile(PageSourceImpl.java:476) at lucee.runtime.PageSourceImpl.compile(PageSourceImpl.java:442) at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:348) at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:191) at lucee.runtime.component.ComponentLoader.loadPage(ComponentLoader.java:583) at lucee.runtime.util.TemplateUtilImpl.loadPage(TemplateUtilImpl.java:76) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:447) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:417) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:422) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:399) at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:379) at org.lucee.extension.orm.hibernate.HibernateORMEngine.getSessionFactoryData(HibernateORMEngine.java:132) at org.lucee.extension.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:70) at lucee.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:3067) at lucee.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:3051) at lucee.runtime.config.SingleContextConfigWeb.resetORMEngine(SingleContextConfigWeb.java:1028) at lucee.runtime.config.ConfigWebImpl.resetORMEngine(ConfigWebImpl.java:664) at lucee.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:75) at lucee.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:507) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:112) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2803) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2790) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2761) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1098) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1055) 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:590) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:54) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at runwar.undertow.SSLCertHeaderHandler.handleRequest(SSLCertHeaderHandler.java:161) at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:175) at io.undertow.server.handlers.HttpContinueReadHandler.handleRequest(HttpContinueReadHandler.java:69) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at runwar.undertow.WelcomeFileHandler.handleRequest(WelcomeFileHandler.java:49) at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104) at runwar.undertow.SiteDeployment$1.handleRequest(SiteDeployment.java:164) at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:141) at io.undertow.server.handlers.DisallowedMethodsHandler.handleRequest(DisallowedMethodsHandler.java:62) at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:113) at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72) at runwar.undertow.LifecyleHandler.handleRequest(LifecyleHandler.java:143) at runwar.undertow.SiteDeployment$4.handleRequest(SiteDeployment.java:354) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:854) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.ClassCastException: class lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to class lucee.transformer.bytecode.statement.tag.TagComponent (lucee.transformer.bytecode.statement.ExpressionAsStatement and lucee.transformer.bytecode.statement.tag.TagComponent are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @7e7f0f0a)

Environment

Lucee Hibernate ORM 3.5.5.89 (but also tried extension v 5.x

Attachments

2
  • 17 Mar 2025, 02:08 pm
  • 14 Mar 2025, 05:08 pm

Activity

Show:

Michael Offner 18 March 2025 at 21:54

Based on

Caused by: java.lang.ClassCastException: class lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to class lucee.transformer.bytecode.statement.tag.TagComponent

i added a check if the statement returned is from type TagComponent or not, if not the parser simply goes on
https://github.com/lucee/Lucee/commit/a3725930ade48bf18f89576d3ceb880d34822cd5

if that fixes this issue or not is unclear and as long i have not the source code causing this, i have no chance to verify.
i know that it must be some code with component<space> , but still valid code, i tried to reproduce the issue with code like this

<cfscript> component = 1; dump(variables); </cfscript>

but that did work just fine

without any further input on this and when all test cases passes after this change, we have to assume that the issue is fixed and close this ticket.
What is certain if their code still fail, they will see a different exception, that maybe gives more inside.

Michael Offner 17 March 2025 at 14:08

there is something else going on here, i also get a proper exception when i delete an extended component

Screenshot 2025-03-17 at 15.01.53.png

try/finally is absolutely fine in that context, it simply clean up and then escalates the exception.

your exception completely differs from the exception in the description, yours is a runtime exception, the exception in the description is a compiler exception. something goes wrong when compiling code. compiler errors are easy to reproduce because they do not depend on a specific environment, so we simply need the template that fails to compile and when we have it, we can reproduce the issue.

Zac Spitzer 17 March 2025 at 12:11

I tried to reproduce this error, i.e. with an invalid model cfc extends, but the error message was useful for both orm 5.4 and 3.5.5

[java] [script] Errored: testAdditional.ormconfig [java] [script] testORMConfig [java] [script] invalid component definition, can't find component [zac] [java] [script] d:\work\lucee-extensions\extension-hibernate\tests\ormconfig\Auto.cfc:1 [java] [script] d:\work\lucee-extensions\extension-hibernate\tests\ormconfig.cfc:6 [java] [script] d:\work\lucee6\test\_testRunner.cfc:297 [java] [script] d:\work\lucee6\test\run-tests.cfm:351 [java] [script] /bootstrap-tests.cfm:112 [java] [script] [java] [script] lucee.runtime.exp.ExpressionException: invalid component definition, can't find component [zac] [java] [script] at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:215) [java] [script] at lucee.runtime.component.ComponentLoader.searchComponent(ComponentLoader.java:90) [java] [script] at lucee.runtime.ComponentImpl.init(ComponentImpl.java:389) [java] [script] at ormconfig.auto_cfc$cf$13.initComponent(/testAdditional/ormconfig/Auto.cfc) [java] [script] at ormconfig.auto_cfc$cf$13.newInstance(/testAdditional/ormconfig/Auto.cfc:1) [java] [script] at lucee.runtime.component.ComponentLoader.initComponent(ComponentLoader.java:700) [java] [script] at lucee.runtime.component.ComponentLoader._loadComponent(ComponentLoader.java:639) [java] [script] at lucee.runtime.component.ComponentLoader.loadComponent(ComponentLoader.java:506) [java] [script] at lucee.runtime.component.ComponentLoader.loadComponent(ComponentLoader.java:496) [java] [script] at lucee.runtime.util.TemplateUtilImpl.loadComponent(TemplateUtilImpl.java:87) [java] [script] at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:349) [java] [script] at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:317) [java] [script] at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:278) [java] [script] at org.lucee.extension.orm.hibernate.HibernateSessionFactory.loadComponents(HibernateSessionFactory.java:240) [java] [script] at org.lucee.extension.orm.hibernate.HibernateORMEngine.buildSessionFactoryData(HibernateORMEngine.java:180) [java] [script] at org.lucee.extension.orm.hibernate.HibernateORMEngine.getOrBuildSessionFactoryData(HibernateORMEngine.java:120) [java] [script] at org.lucee.extension.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:62)

there’s a try finally without a catch here?

https://github.com/lucee/Lucee/blob/6.2/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java#L868

ort we could add some context to this exception?
https://github.com/lucee/Lucee/blob/6.2/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java#L382

Michael Offner 17 March 2025 at 09:49

so do we have an issue not to get a proper exception message then or is this a non issue?

Zac Spitzer 15 March 2025 at 16:42
Edited

Via slack:

So, I think this had to do with component file not found due to a directory mapping issue . This resulted in some components that use extends="path.to.basecomponent" not being able to get instantiated. Once I fixed the mappings, seemed to run properly both locally and via Docker

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 13 March 2025 at 09:51
Updated 1 hour ago
Resolved 1 hour ago

Flag notifications