[Coldbox 4.30]invalid component definition, can't find component [cborm.models.EventHandler]

Hi, I am going through the samples of cold box. One of them is TaskManager. After I add my database table to the datasource and try to run it. It shows invalid component definition, can’t find component [cborm.models.EventHandler] .
I have the mapping for cborm. It still shows this error.

Lucee 4.5.5.006 Error (expression)
Message invalid component definition, can’t find component [cborm.models.EventHandler]
Java Stacktrace invalid component definition, can’t find component [cborm.models.EventHandler]
at lucee.runtime.component.ComponentLoader.load(ComponentLoader.java:314):314
at lucee.runtime.component.ComponentLoader.loadComponent(ComponentLoader.java:59):59
at lucee.runtime.PageContextImpl.loadComponent(PageContextImpl.java:2963):2963
at lucee.runtime.orm.hibernate.HibernateORMEngine.addEventListeners(HibernateORMEngine.java:234):234
at lucee.runtime.orm.hibernate.HibernateORMEngine.getSessionFactoryData(HibernateORMEngine.java:216):216
at lucee.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:88):88
at lucee.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2934):2934
at lucee.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2919):2919
at lucee.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:75):75
at lucee.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:448):448
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:115):115
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:37):37
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2271):2271
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2234):2234
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790):790
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85):85
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129):129
at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47):47
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61):61
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131):131
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84):84
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62):62
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36):36
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131):131
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57):57
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43):43
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46):46
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64):64
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60):60
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77):77
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43):43
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43):43
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43):43
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292):292
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81):81
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138):138
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135):135
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48):48
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43):43
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272):272
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81):81
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104):104
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:211):211
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809):809
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at java.lang.Thread.run(Thread.java:745):745

Timestamp 8/31/17 3:11:11 PM HKT

Save your highlight. Join Sign In

Highlights by 0

Hi,

Please check ORM settings in Application.cfc, also make sure Application.cfc have cborm mapping.

example

this.mappings[ "/cborm" ] = COLDBOX_APP_ROOT_PATH & "modules/cborm";

Docs
https://github.com/coldbox-modules/cbox-cborm/wiki

Hi,
yes, I have this setting in the application.cfc.
And also I have tried to build a mini simple project with a db table, the same error.

(I am sorry if the problem is too naive for I just start learning coldbox)

Thank you very much. I have found the bug, the orm eventHandler route is not accurate. Thanks!

Can you explain? If the sample app needs to be updated, please send a pull request. We haven’t reviewed those in a long time.

~Brad

This means you don’t have the mapping this.mappings[ “/cborm” ] defined in your Application.cfc ( or you’re using a really old version of Adobe Coldfusion ). Any application using cborm must have this mapping to the module root.

Actually I have this mapping

Hi, I am not quite sure whether I am doing this in the right way. The original path for event Handler in the Application.cfc is “cborm.models.EventHandler”.
And I put the task manager app into a new folder, like create a individual app. And change the path into “modules.cborm.models.eventHandler”. Then it works.
(I am sorry if the problem is too simple. just start learning coldbox)

Is it in your Application.cfc before you declare your ORM settings – outside of your onApplicationStart() method? Sorry, didn’t read further down in the chain of emails. Something is not taking with that mapping before the ORM is initialized.

yes~