[Coldbox-6.2] invalidEventHandler doesn't seem to be working?

I’m including just the relevant attributes of my coldbox config struct below:

coldbox = {
missingTemplateHandler = “Missing.Template”,
exceptionHandler = “Main.onException”,
invalidEventHandler = “missing.unknownEvent”,
customErrorTemplate = “”,
};

So, if I navigate to an event that exists but the action doesn’t, shouldn’t the invalidEventHandler fire? Or is it the missingTemplateHandler? Based on the error I’m getting, ColdBox is trying to run something in our “Missing” handler.

For example, I have a handler named “api” and I try to load this page: www.mysite.com/api/doesnotexist, I will get the following error:

component [handlers.Missing] has no function with name [doesnotexist]

lucee.runtime.exp.ExpressionException: component [handlers.Missing] has no function with name [doesnotexist] at lucee.runtime.type.util.ComponentUtil.notFunction(ComponentUtil.java:687) at lucee.runtime.ComponentImpl.onMissingMethod(ComponentImpl.java:609) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:898) at lucee.runtime.functions.dynamicEvaluation.Invoke.call(Invoke.java:49) at coldbox.system.web.controller_cfc$cf.udfCall3(/coldbox/system/web/Controller.cfc:1137) at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207) at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:792) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729) at coldbox.system.web.controller_cfc$cf.udfCall3(/coldbox/system/web/Controller.cfc:933) at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207) at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:792) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729) at coldbox.system.web.controller_cfc$cf.udfCall2(/coldbox/system/web/Controller.cfc:643) at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729) at coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:259) at coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc) 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.type.scope.UndefinedImpl.call(UndefinedImpl.java:779) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710) at coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:483) at coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc) 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:680) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710) at application_cfc$cf.udfCall(/Application.cfc:179) 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:680) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:436) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:132) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2416) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2406) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2381) at lucee.runtime.engine.Request.exe(Request.java:43) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1170) 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: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 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.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:251) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:186) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:227) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:149) at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:111) at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:45) 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.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:251) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:186) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:227) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:149) at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:111) at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:215) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171) 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:132) 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:531) 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:269) at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) 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:249) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:841) 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 java.base/java.lang.Thread.run(Thread.java:832)

[COLDBOX-964] invalidEventHandler does not work when calling invalid action on valid handler - Welcome (which has a workaround until it’s fixed)

1 Like

Just submitted a PR for this. Thanks for the good reproduction, @inLeague.

1 Like

Can someone show me how to use commandbox to update my ColdBox package to this build with the fix? I can’t seem to figure out the correct command.

Should be box install coldbox@be --force

1 Like