I’m running a CFWheels 3.0 application on a BoxLang server and encountered some errors during initialization. After some debugging, I realized that I needed to install specific modules from ForgeBox to get things working properly.
First, I installed two modules: “Unsafe Evaluate” and “BoxLang Compat Module” The “Unsafe Evaluate” module enabled the evaluate function used in CFWheels 3.0, and the “BoxLang Compat Module” allowed other functions like getComponentMetadata() to work.
Since I’m using a MySQL database, I also installed the “BoxLang MySQL” module for MySQL compatibility. There were some additional errors related to CFWheels needing to determine the server version, which only had options for Lucee or Adobe. I added an option for BoxLang, which resolved that issue.
However, I’m currently stumped by another issue. CFWheels has a file called EventMethods.cfc that it uses to initialize functions for the lifecycle methods. Each lifecycle function in the “Application.cfc” calls a corresponding function using $simplelock. The problem is that while some functions initialize correctly, others throw errors inconsistently. For example, sometimes it’s the onRequestEnd function, other times it’s onSessionStart, and sometimes it’s onError. The arguments for these functions are the same except for the function name, and all the functions have the same return type and are located in the same file, EventMethods.cfc.
Here is the link for the CFWheels’s 3.0 version: CFWheels
Thanks in advance for any help or insights you can provide!
I did spend some time trying to get 2.0 working, but haven’t tried 3.0. Do you have a stacktrace or anything which might provide some clues (I know it’s inconsistent but a stacktrace may reveal something)?
For the engine detection then you can add a boxlang.json config
This is the Stack trace. Hope it helps:
[ERROR] runwar.context: ortus.boxlang.runtime.types.exceptions.BoxCastException: String cannot be cast to a boolean
[ERROR] runwar.context: at ortus.boxlang.runtime.dynamic.casters.BooleanCaster.cast(BooleanCaster.java:143)
[ERROR] runwar.context: at ortus.boxlang.runtime.dynamic.casters.BooleanCaster.cast(BooleanCaster.java:81)
[ERROR] runwar.context: at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:167)
[ERROR] runwar.context: at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:105)
[ERROR] runwar.context: at ortus.boxlang.runtime.validation.Type.validate(Type.java:37)
[ERROR] runwar.context: at ortus.boxlang.runtime.components.ComponentDescriptor.invoke(ComponentDescriptor.java:196)
[ERROR] runwar.context: at ortus.boxlang.runtime.context.BaseBoxContext.invokeComponent(BaseBoxContext.java:460)
[ERROR] runwar.context: at boxgenerated.boxclass.wheels.Global$cfc$Func_$simpleLock._invoke(Global$cfc.java:18973)
[ERROR] runwar.context: at ortus.boxlang.runtime.types.Function.invoke(Function.java:177)
[ERROR] runwar.context: at ortus.boxlang.runtime.runnables.BoxClassSupport.dereferenceAndInvoke(BoxClassSupport.java:397)
[ERROR] runwar.context: at boxgenerated.boxclass.wheels.Global$cfc.dereferenceAndInvoke(Global$cfc.java:505)
[ERROR] runwar.context: at ortus.boxlang.runtime.interop.DynamicInteropService.dereferenceAndInvoke(DynamicInteropService.java:1785)
[ERROR] runwar.context: at ortus.boxlang.runtime.interop.DynamicInteropService.dereferenceAndInvoke(DynamicInteropService.java:1767)
[ERROR] runwar.context: at ortus.boxlang.runtime.dynamic.Referencer.getAndInvoke(Referencer.java:134)
[ERROR] runwar.context: at boxgenerated.boxclass.Application$cfc$Func_onError._invoke(Application$cfc.java:1089)
[ERROR] runwar.context: at ortus.boxlang.runtime.types.Function.invoke(Function.java:177)
[ERROR] runwar.context: at ortus.boxlang.runtime.runnables.BoxClassSupport.dereferenceAndInvoke(BoxClassSupport.java:313)
[ERROR] runwar.context: at boxgenerated.boxclass.Application$cfc.dereferenceAndInvoke(Application$cfc.java:695)
[ERROR] runwar.context: at ortus.boxlang.runtime.application.ApplicationClassListener.onError(ApplicationClassListener.java:171)
[ERROR] runwar.context: at ortus.boxlang.web.WebRequestExecutor.execute(WebRequestExecutor.java:109)
[ERROR] runwar.context: at ortus.boxlang.servlet.BoxLangServlet.service(BoxLangServlet.java:105)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
[ERROR] runwar.context: at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:54)
[ERROR] runwar.context: at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
[ERROR] runwar.context: at runwar.undertow.SSLCertHeaderHandler.handleRequest(SSLCertHeaderHandler.java:161)
[ERROR] runwar.context: at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:257)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:182)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:188)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:136)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:99)
[ERROR] runwar.context: at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:52)
[ERROR] runwar.context: at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
[ERROR] runwar.context: at runwar.undertow.SSLCertHeaderHandler.handleRequest(SSLCertHeaderHandler.java:161)
[ERROR] runwar.context: at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:257)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:182)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:188)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImplSetup(RequestDispatcherImpl.java:136)
[ERROR] runwar.context: at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:99)
[ERROR] runwar.context: at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:215)
[ERROR] runwar.context: at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
[ERROR] runwar.context: at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
[ERROR] runwar.context: at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
[ERROR] runwar.context: at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:405)
[ERROR] runwar.context: at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[ERROR] runwar.context: at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
[ERROR] runwar.context: at runwar.undertow.SSLCertHeaderHandler.handleRequest(SSLCertHeaderHandler.java:161)
[ERROR] runwar.context: at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
[ERROR] runwar.context: at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
[ERROR] runwar.context: at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
[ERROR] runwar.context: at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
[ERROR] runwar.context: at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
[ERROR] runwar.context: at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
[ERROR] runwar.context: at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:175)
[ERROR] runwar.context: at io.undertow.server.handlers.HttpContinueReadHandler.handleRequest(HttpContinueReadHandler.java:69)
[ERROR] runwar.context: at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: at runwar.undertow.WelcomeFileHandler.handleRequest(WelcomeFileHandler.java:39)
[ERROR] runwar.context: at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104)
[ERROR] runwar.context: at runwar.undertow.SiteDeployment$1.handleRequest(SiteDeployment.java:162)
[ERROR] runwar.context: at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:141)
[ERROR] runwar.context: at io.undertow.server.handlers.DisallowedMethodsHandler.handleRequest(DisallowedMethodsHandler.java:62)
[ERROR] runwar.context: at io.undertow.predicate.PredicatesHandler.handleRequest(PredicatesHandler.java:113)
[ERROR] runwar.context: at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
[ERROR] runwar.context: at runwar.undertow.LifecyleHandler.handleRequest(LifecyleHandler.java:143)
[ERROR] runwar.context: at runwar.undertow.SiteDeployment$4.handleRequest(SiteDeployment.java:345)
[ERROR] runwar.context: at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
[ERROR] runwar.context: at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852)
[ERROR] runwar.context: at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] runwar.context: at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019)
[ERROR] runwar.context: at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558)
[ERROR] runwar.context: at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449)
[ERROR] runwar.context: at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
[ERROR] runwar.context: at java.base/java.lang.Thread.run(Thread.java:1583)
That’s a bit of an oxymoron. If they’d released 3.0, it’d be… you know… released. That you need to get it from develop demonstrates it’s not released
2.5.1 is the current supported version of CFWheels as far as I can tell.
Based on what you’ve given Brad to go on (not really very much. “it’s not working” isn’t very helpful), if I was him I’d just be going “shrug”.
As with any bug (even if it is one, which is not clear as yet), I’d be expecting you to put the effort in to isolate a reproduction case, including expected and actual behaviour, and the basis for your expected behaviour, eg; “on CF2023 this repro does x; same on Lucee. On BL however it does y”.
Examples of tickets I’ve raised from CFWheels issues in BL:
This is a start. Can you also get the tag context from the error message? We don’t have proper line numbers yet in our bytecode until we finalize the ASM effort so the actual corresponding line number from the original Global.cfc file will be in the tag stack.
On whatever line of CF code that maps to line 18,973 of the generated Java source, there is a tag being called which accepts a boolean attribute that you are passing a non-boolean to. There SHOULD be a much better error message saying something like “argument XYZ to component ABC” is of the wrong type or something so I’m not sure if you forgot to copy that or what.
Looking at the code in that function
I actually don’t see any components (tags) being called that are being passed a boolean. In fact, CFLock is about the only tag in there at all. It does have a throwOnTimeout attribute but your code isn’t using it. We really need to get the line number and confirm you don’t have any local code that’s not on GitHub.
This is the tag context for my application that is giving error. As you can see it gives error in the $invoke function but I have debugged the function to see if there is some argument missing but everything is ok until the cfinvoke tag. The arguments for the cfinvoke are also correct. Hope this helps:
@aliaspooryorik@adamcameron
Thank you for your feedback!
You’re correct that stable releases are typically found on the main branch, and currently, version 3.0 is still being finalized, which is why it’s in the develop branch. This branching strategy allows us to continue improving and testing features before marking them as stable.
However, the work being done in the develop branch for 3.0 is nearing completion, and many users have been successfully testing it without major issues. While there isn’t an official stable tag for 3.0 just yet, it is in the final stages of refinement. Once it’s ready, it will be tagged as stable and moved to the main branch.
We appreciate your patience and encourage you to keep an eye on the updates, as the stable release is coming soon!
Showing Brad a picture of an error from an application running on your computer is not help to anyone.
Work out what’s causing the issue and give him that.
As per those Jira tickets I pointed you to earlier. Those were all issues in CFWheels, which were giving nebulous “it no worky” errors which unless Brad was here with me looking over my shoulder would be absolutely no frickin use to him because there were all contingent on a specific set of circumstances (inputs to code) that are not at all apparent from a stack trace or a error context.
But it always boils down to “if you use these values in this CFML code, you get this error on BL and you don’t on CF or Lucee”. Always. It’s not magic. This is just common sense (and kinda “Code Troubleshooting 101” to boot).
Isolate the inputs and outputs to some stand-alone CFML code that demonstrates the issue, and give that to Brad.
@bdw429s
I have created a separate project consisting of three essential files. The first is server.json , which contains only the minimal configuration required to start the server via CommandBox. The second file, index.cfm , serves as the landing page for our application and includes the necessary arguments for the cfinvoke tag within it. The third file is a CFC that includes a function designed to print a line of text on the screen.
I have tested this setup across three environments: Lucee 6, Adobe ColdFusion 2018, and BoxLang. Both Lucee 6 and Adobe ColdFusion execute the function correctly, displaying the message “This is the result of an invoke tag” on the screen. However, when running the application on BoxLang, it fails and returns the error “Function ‘runOnRequestEnd’ not found.” The expected behavior in BoxLang should be the execution of the function with the corresponding output displayed on the screen, but instead, it results in an error. Here is the video:
Thanks, but instead of a picture or a video, can you please share the actual test code so I can try it EIther a link to a public repo or just DM’ing me a zip would suffice.
Checking out the repro case now, but just to be clear, the original error you reported was String cannot be cast to a boolean but the error in your last message is function X not found. Did we change to start talking about another error than the original?
Ok, so the “function not found” issue is quite simple and a limitation of our transpiler. We changed the name of the component attribute of the invoke component/tag to class in BoxLang to match our nomenclature. We have a CF → BL transpiler which visits all cfinvoke calls and renames any component attributes, so code like this
<cfinvoke component="foo" method="bar">
gets rewritten to
<cfinvoke class="foo" method="bar">
before it compiles. This works great for explicit attributes, but since you’re using attributeCollection, the transpiler doesn’t “see” the arguments as it’s a runtime evaluated value. So your component attribute gets lost and invoke is just trying to run a function on the page of the same name, which it can’t find of course. I’ll have a think on how to improve our transpilation to handle this better.