[coldbox-4.2] Module and Interceptor issue

90 visualizações
Pular para a primeira mensagem não lida

Jamie Salvatori

não lida,
21 de abr. de 2016, 17:43:0821/04/2016
para ColdBox Platform
Hi!

I've got an interceptor that runs onSessionStart(). When the app starts up for the first time, it is unable to locate the cbstorages module. I'm usingthe provider pattern as far as wirebox injecting is concerned. However, this doesn't mitigate the issue that our onSessionStart() interceptor needs to access cookie and session scopes from within that function and that this probably occurs before the module is loaded.

I suppose I'm asking if there's a way to know from within the interceptor if the cbstorages module has been loaded yet.

The other solution, I suppose, is to access those scopes directly, but I'd prefer to keep everything abstracted.

Here's the error:

Could not find the ColdFusion component or interface cbstorages.models.CookieStorage.

Here's a condensed version of the interceptor code:

<cfcomponent hint="This interceptor is for when a new session starts"
output="false"
extends="coldbox.system.Interceptor">

<!------------------------------------------- CONSTRUCTOR ------------------------------------------->

<cfproperty name="cart" inject="id:cart">
<cfproperty name="sessionStorage" inject="provider:sessionStorage@cbstorages">
<cfproperty name="cookieStorage" inject="provider:cookieStorage@cbstorages">

<cffunction name="configure" access="public" returntype="void" hint="" output="false" >
<cfscript>
</cfscript>
</cffunction>

<!------------------------------------------- INTERCEPTION POINTS ------------------------------------------->

<cffunction name="sessionStart" access="public" returntype="void" hint="" >
<!--- ************************************************************* --->
<cfargument name="event" required="true" hint="The event object.">
<cfargument name="interceptData" required="true" hint="interceptData of intercepted info.">
<!--- ************************************************************* --->
<cfset cart.create()>
<cfif comparenocase(cookieStorage.getVar("adid"), "") neq 0>
<cfset sessionStorage.setVar("adid", left(cookieStorage.getVar("adid"),15))>

</cfif>

</cffunction>
</cfcomponent>

I've included the full stack trace below. The interceptor above is onSessionStart.cfc, but the line #'s won't match up since I took out code that doesn't affect this issue.

Thanks in advance!!!
-Jamie

Stack Trace
at cfUtil2ecfc566506195$funcGETINHERITEDMETADATA.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/core/util/Util.cfc:222) at cfMapping2ecfc1560754631$funcPROCESS.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/config/Mapping.cfc:599) at cfInjector2ecfc54530072$funcGETINSTANCE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Injector.cfc:249) at cfBuilder2ecfc1067877924$funcGETMODELDSL.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:471) at cfBuilder2ecfc1067877924$funcBUILDDSLDEPENDENCY.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:362) at cfBuilder2ecfc1067877924$funcBUILDSIMPLEDSL.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:309) at cfInjector2ecfc54530072$funcGETINSTANCE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Injector.cfc:218) at cfProvider2ecfc983324759$funcGET.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Provider.cfc:49) at cfProvider2ecfc983324759$funcONMISSINGMETHOD.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Provider.cfc:63) at cfonSessionStart2ecfc35495225$funcSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/interceptors/onSessionStart.cfc:29) at cfInterceptorState2ecfc1430097988$funcINVOKER.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:369) at cfInterceptorState2ecfc1430097988$funcPROCESSSYNC.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:260) at cfInterceptorState2ecfc1430097988$funcPROCESS.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:121) at cfInterceptorService2ecfc1982732150$funcPROCESSSTATE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/services/InterceptorService.cfc:139) at cfBootstrap2ecfc361895422$funcONSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/Bootstrap.cfc:390) at cfApplication2ecfc368880181$funcONSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/Application.cfc:147) 

coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find the ColdFusion component or interface cbstorages.models.CookieStorage.
	at coldfusion.runtime.TemplateProxyFactory.getResolvedFile(TemplateProxyFactory.java:1355)
	at coldfusion.runtime.TemplateProxyFactory.getTemplateFileHelper(TemplateProxyFactory.java:1582)
	at coldfusion.runtime.MetadataUtils.getComponentMetadata(MetadataUtils.java:110)
	at coldfusion.runtime.CfJspPage.GetComponentMetadata(CfJspPage.java:2936)
	at cfUtil2ecfc566506195$funcGETINHERITEDMETADATA.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/core/util/Util.cfc:222)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
	at cfMapping2ecfc1560754631$funcPROCESS.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/config/Mapping.cfc:599)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
	at cfInjector2ecfc54530072$funcGETINSTANCE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Injector.cfc:249)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
	at cfBuilder2ecfc1067877924$funcGETMODELDSL.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:471)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
	at cfBuilder2ecfc1067877924$funcBUILDDSLDEPENDENCY.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:362)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
	at cfBuilder2ecfc1067877924$funcBUILDSIMPLEDSL.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Builder.cfc:309)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
	at cfInjector2ecfc54530072$funcGETINSTANCE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Injector.cfc:218)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
	at cfProvider2ecfc983324759$funcGET.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Provider.cfc:49)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2845)
	at cfProvider2ecfc983324759$funcONMISSINGMETHOD.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/ioc/Provider.cfc:63)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:291)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:664)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
	at cfonSessionStart2ecfc35495225$funcSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/interceptors/onSessionStart.cfc:29)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
	at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:406)
	at cfInterceptorState2ecfc1430097988$funcINVOKER.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:369)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
	at cfInterceptorState2ecfc1430097988$funcPROCESSSYNC.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:260)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
	at cfInterceptorState2ecfc1430097988$funcPROCESS.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/context/InterceptorState.cfc:121)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
	at cfInterceptorService2ecfc1982732150$funcPROCESSSTATE.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/web/services/InterceptorService.cfc:139)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
	at cfBootstrap2ecfc361895422$funcONSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/coldbox/system/Bootstrap.cfc:390)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2483)
	at cfApplication2ecfc368880181$funcONSESSIONSTART.runFunction(/Users/jamiemsalvatori/CODE/Vat19-Development/MyApp/Application.cfc:147)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
	at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
	at coldfusion.runtime.AppEventInvoker.onSessionStart(AppEventInvoker.java:432)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:405)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)
	at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
	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 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

br...@bradwood.com

não lida,
21 de abr. de 2016, 17:51:5921/04/2016
para col...@googlegroups.com
Is this issue for every user, or only for the first hit to the application?  As long as the app is started up, I don't see why all the modules wouldn't be loaded.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/ae500d09-c247-4b62-a87e-a0325c666b1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jamie Salvatori

não lida,
21 de abr. de 2016, 18:48:2721/04/2016
para ColdBox Platform
Pretty sure it's just the first hit to the app.

br...@bradwood.com

não lida,
21 de abr. de 2016, 18:57:1321/04/2016
para col...@googlegroups.com
I'm not actually sure the order that the methods in Application.cfc are called?  is onSessionStart running before onRequest?  i wonder if this is an issue of the framework not having booted up yet due to not having a check to ensure the framework is loaded.
 
Can you put in some debugging to try and figure the order that stuff is getting called?
--------- Original Message ---------

Jamie Salvatori

não lida,
21 de abr. de 2016, 18:58:0421/04/2016
para ColdBox Platform
To add a bit more context: This same code worked fine on first app init in CB 3.8.1 when I was using the sessionstorage and cookiestorage plugins. So, it definitely has to do with the modules not being loaded when onSessionStart is called. I was hoping there's a way to get around that.

Jamie Salvatori

não lida,
21 de abr. de 2016, 19:05:3021/04/2016
para ColdBox Platform
According to Adobe (and I'm sure Lucee follows same), the order of function calls from application.cfc is:

When a request executes, ColdFusion runs the CFC methods in the following order:

  1. onApplicationStart (if not run before for this application)
  2. onSessionStart (if not run before for this session)
  3. onRequestStart
  4. onRequest/onCFCRequest
  5. onRequestEnd
The onApplicationEnd, onSessionEnd, and onError CFCs are triggered by specific events.

Jon Clausen

não lida,
21 de abr. de 2016, 19:11:3721/04/2016
para col...@googlegroups.com
Jamie,

Declare the properties but omit the injection.  Then set the properties manually in your configure() method using Wirebox. 

I had a near-exact same issue recently on a CB4 upgrade which used injected plugins in the interceptors.  It’s because the interceptors are loaded (but not configured) before the modules.   In this case your onSessionStart() isn’t even firing.  Coldbox is throwing the error because it’s trying to inject the component with references which don’t yet exist.

HTH,

Jon

Jamie Salvatori

não lida,
21 de abr. de 2016, 19:40:4721/04/2016
para ColdBox Platform
Thanks for the advice, Jon. However, I must be doing something incorrectly.

I declared the properties and then I tried to set them to instances of the sessionStorage and cookieStorage CFCs (see code below) and get the following error:

Requested instance not found: 'sessionStorage@cbstorages'

The instance could not be located in any declared scan location(s) (models) or full path location

<cfproperty name="sessionStorage">
<cfproperty name="cookieStorage">

<cffunction name="configure" access="public" returntype="void" hint="" output="false" >
<cfscript>
sessionStorage = getInstance("sessionStorage@cbstorages");
cookieStorage = getInstance("cookieStorage@cbstorages");
</cfscript>
</cffunction>

Jon Clausen

não lida,
21 de abr. de 2016, 20:41:5721/04/2016
para col...@googlegroups.com

No, you’re not doing anything wrong. My bad. I forgot I had to move the even further down in the chain of events. They can to go in the afterConfigurationLoad function like so:

void function afterConfigurationLoad(){
        variables.Storage = variables.Wirebox.getInstance( "sessionStorage@cbstorages" );
    }

Jamie Salvatori

não lida,
22 de abr. de 2016, 00:05:0122/04/2016
para ColdBox Platform
Yep, that seemed to work. Thank you very much!
...
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem