[ColdBox 6.5.2] [cborm & rest-hmvc]: key [CBBOOTSTRAP] doesn't exist

Recently, using CommandBox 5.4.2, I created a ColdBox 6.5.2 app with the following commands:

> coldbox create app name=apix skeleton=rest-hmvc
> install cborm

/models/Product.cfc

component entityname="Product" persistent="true" {

	property name="id" fieldtype="id" generator="native";
	property name="name" fieldtype="column" ormtype="string";

	function init() localmode="modern" {
		return this;
	}

}

/Application.cfc

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

	this.datasource = "apix";
	this.ormEnabled = true;
	this.ormSettings = {
		cfcLocation = [ "models" ], // Where our entities exist
		logSql = false, // Remove after development to false.
		dbCreate = "dropcreate", // Generate our DB
		autoManageSession = false, // Let cborm manage it
		flushAtRequestEnd = false, // Never do this! Let cborm manage it
		eventHandling = true, // Enable events
		eventHandler = "cborm.models.EventHandler", // Who handles the events
		skipCfcWithError = true // Yes, because we must work in all CFML engines
	};

/box.json

{
    "name":"apix",
    "version":"1.0.0",
    "location":"",
    "author":"You",
    "slug":"apix",
    "createPackageDirectory":false,
    "type":"mvc",
    "homepage":"https://github.com/coldbox-templates/rest-hmvc",
    "documentation":"https://github.com/coldbox-templates/rest-hmvc",
    "repository":{
        "type":"git",
        "url":"https://github.com/coldbox-templates/rest-hmvc"
    },
    "bugs":"https://github.com/coldbox-templates/rest-hmvc/issues",
    "shortDescription":"A modular API RESTFul template",
    "contributors":[],
    "ignore":[],
    "devDependencies":{
        "testbox":"^4.0.0",
        "relax":"^4.1.0",
        "route-visualizer":"*",
        "commandbox-dotenv":"*",
        "commandbox-cfconfig":"*",
        "commandbox-cfformat":"*"
    },
    "installPaths":{
        "coldbox":"coldbox/",
        "relax":"modules/relax/",
        "testbox":"testbox/",
        "cbSwagger":"modules/cbSwagger/",
        "route-visualizer":"modules/route-visualizer/",
        "mementifier":"modules/mementifier/",
        "cbvalidation":"modules/cbvalidation/",
        "cbsecurity":"modules/cbsecurity/",
        "cborm":"modules/cborm/"
    },
    "dependencies":{
        "coldbox":"^6.0.0",
        "cbsecurity":"^2.5.0+94",
        "mementifier":"^2.1.0+100",
        "cbvalidation":"^2.1.0+126",
        "cborm":"^3.4.0+211"
    },
    "scripts":{}
}

It worked fine. In database, the Product table was created. However, everytime I restarted the server, I got the following error. Could someone help me to find out why is happening? Thank you.

Lucee 5.3.8.206 Error (expression)
Message	key [CBBOOTSTRAP] doesn't exist
Stacktrace	The Error Occurred in
/Users/administrator/Sites/kulakula/subdomains/apix/wwwroot/Application.cfc: line 62 
60: public boolean function onRequestStart( string targetPage ) {
61: // If we reinit our app, reinit the ORM too
62: if ( application.cbBootstrap.isFWReinit() ) {
63: ormReload();
64: }

Java Stacktrace	lucee.runtime.exp.ExpressionException: key [CBBOOTSTRAP] doesn't exist
  at lucee.runtime.type.util.StructSupport.invalidKey(StructSupport.java:67)
  at lucee.runtime.type.StructImpl.get(StructImpl.java:139)
  at application_cfc$cf.udfCall(/Application.cfc:62)
  at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
  at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
  at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:684)
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:572)
  at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911)
  at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:437)
  at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:133)
  at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460)
  at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450)
  at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421)
  at lucee.runtime.engine.Request.exe(Request.java:45)
  at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179)
  at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125)
  at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
  at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
  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 org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47)
  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
  at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
  at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
  at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
  at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:405)
  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
  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 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 runwar.Server$1.handleRequest(Server.java:510)
  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:280)
  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:260)
  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79)
  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852)
  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:1280)
  at java.base/java.lang.Thread.run(Unknown Source)

By any chance, was anyone able to see the problem? I tried to narrow down and found both templates/skeletons: “rest-hmvc” and “rest” exhibited the same problem. “advanced-script” works fine.

It seems that the new templates had not published. I just published them right now. Please try again.

Hi Luis… Thanks for pushing the updated templates. Unfortunately, I’m still getting the same error.

@Ancient_Programmer did you solve the issue?

I met the same problem. As long as I turned off the “eventHandling”, the error would be gone.

// Application.cfc
this.ormSettings = {
  ...
  eventHandling = false,
  ...
}

But it doesn’t actually solve any problem.

So I’m wondering if you had got any further findings to share.

Thanks.

Hi… I found the answer at Cborm event handling: tracking some Lucee problems. – ShiftInsert.nl

He explained the problem; and proposed a work-around. Seems to be working okay now.

Good luck!

2 Likes

That works! Yeah! I really appreciate your quick reply! :slight_smile:

Having read that article, is there any “official” recommended way to configure an app using ORM Events to avoid this error? Here’s the offending commit referenced in the article.

Thanks Luis!

Luis reported this has already been addressed in the latest Bleeding Edge:

1 Like