I have an issue where I am receivng "Element Plugins is undefinied" error. I am using cfwheels v1.3 on Coldfusion 10.
The thing is that it works perfectly on my local machine which is using coldfusion 11 but has the exact same codebase.
The error occurred in D:/Websites/nxtgig.involveid.com/wwwroot/ngTesting/wheels/global/public.cfm: line 363 Called from D:/Websites/nxtgig.involveid.com/wwwroot/ngTesting/wheels/events/onrequestend/debug.cfm: line 130 Called from D:/Websites/nxtgig.involveid.com/wwwroot/ngTesting/wheels/global/cfml.cfm: line 117 Called from D:/Websites/nxtgig.involveid.com/wwwroot/ngTesting/wheels/events/onrequestend.cfm: line 7
361 : else
362 : {
363 : loc.returnValue = application[loc.appKey][arguments.name];
364 : }
365 : </cfscript>
You can see the error here as its located at the bottom of the page. http://gig.nxt.link/ngtesting/index.cfm?controller=authenticate&action=login
coldfusion.runtime.UndefinedElementException: Element plugins is undefined in a CFML structure referenced as part of an expression.
at coldfusion.runtime.CfJspPage.ArrayGetAt(CfJspPage.java:974)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:985)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:980)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:690)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:672)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:637)
at coldfusion.runtime.CfJspPage._arrayGetAt(CfJspPage.java:624)
at cfpublic2ecfm882042214$funcGET.runFunction(D:\Websites\nxtgig.involveid.com\wwwroot\ngTesting\wheels\global\public.cfm:363)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
at cfdebug2ecfm1977824709.runPage(D:\Websites\nxtgig.involveid.com\wwwroot\ngTesting\wheels\events\onrequestend\debug.cfm:130)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)
at cfcfml2ecfm1611265968$func$INCLUDEANDOUTPUT.runFunction(D:\Websites\nxtgig.involveid.com\wwwroot\ngTesting\wheels\global\cfml.cfm:117)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:518)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2624)
at cfonrequestend2ecfm279799770$funcONREQUESTEND.runFunction(D:\Websites\nxtgig.involveid.com\wwwroot\ngTesting\wheels\events\onrequestend.cfm:7)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
at coldfusion.runtime.AppEventInvoker.onRequestEnd(AppEventInvoker.java:343)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:445)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:299)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:246)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:57)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at sun.reflect.GeneratedMethodAccessor5714.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:472)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:312)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:507)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
at sun.reflect.GeneratedMethodAccessor5713.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)
at sun.reflect.GeneratedMethodAccessor5712.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)
at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I'm just going to condense my comments together into a better-formatted answer.
If the codebases really are identical, the configuration must be different somehow. Either something saved to a database is different or the application is being kept alive with invalid data.
Since the error is tripping on this line:
363 : loc.returnValue = application[loc.appKey][arguments.name];
We know that either loc.appkey
or arguments.name
is failing when one has the value of plugins
. It's not loc.appkey
so it must be arguments.name
causing the error.
The red flag here is that it's an application variable tripping. Application variables persist from the point that the application variable is first created until either the server is restarted or the application has expired (reached applicationTimeout
with no application activity. Each access to the application resets the timer).
This activity timer is tied to the application name. It's one of many reasons why it's important to give your applications unique name. On a shared server (especially), you never want to be bland with names, like "shoppingcart". Changing the application name and accessing the website starts the application again. The former application data still exists until whatever time-limit before it expires.
Since the variable is in the application scope, that's the best clue to where to trace it. Something setting an Application variable is not happening.
It may be that it's working on your local machine because hey, things happen, dev boxes get restarted, services are restarted, applications are left idle, however public servers get traffic and search engines and clients visiting to see what has changed. If timeout is set to 24 hours and a person visits at least once every 23 hours and 59 minutes, the application data will stay alive until server/service/force-restart.
I can see from some googling that cfwheels nests many includes (for justifiable reasons) so these functions aren't directly in application.cfc. You can change the application name in config/app.cfm
. After some googling, I feel like this may be the best approach. Simply adding any character to the name should be enough.
But also, from googling, I've found Switching environments on CFWheels
One of the first lines of your application.cfc will usually set this.name
, this is your application name. You can change it if you like and the next visit will be like the first visit after a system restart.
Another way is to add this line of code to onRequestStart()
like this
OnRequestStart is the first event handler that is always called in a request. OnApplicationStart is only run when needed and onSessionStart, similiarly, is only run when a session is created.
<cffunction name="onRequestStart">
<cfargument name="requestname" required=true/>
<cfset structClear(Application)>
<cfset structClear(Session)>
<cfset onApplicationStart()>
<cfset onSessionStart()>
...
</cffunction>
or, for cfscript syntax.
function onRequestStart(requestname) {
structClear(Application);
structClear(session);
onApplicationStart();
onSessionStart();
...
}
You can also contain these in if. Like this.. where the hash is a hashed password. In this case, the hash is a hash of "mike". If the url is appended with ?rextart&rexpw=mike
, it will trigger. (You should choose your own hash string.)
<cffunction name="onRequestStart">
<cfargument name="requestname" required=true/>
<cfif isDefined("url.rextart") and isDefined("url.rexpw")
and hash(url.rexpw) is "18126E7BD3F84B3F3E4DF094DEF5B7DE">
<cfset structClear(Application)>
<cfset structClear(Session)>
<cfset onApplicationStart()>
</cfif>
</cffunction>
I hope that all of this is a help to you.