[ColdBox 4.0] Trying to add modules

I am trying to add the individual modules to our app (the manual way). Cbstorages and cbmessagebox are working fine. When I try to add cbdebugger, cbi18n, or cbcsrf I get that routines are declared more than once. Any ideas?

File/folder structure:

  • webroot
  • coldbox
  • myapp
  • modules
  • cbdebugger
  • cbstorages

Type: Builder.BuildCFCDependencyException

" Routines cannot be declared more than once. The routine isDebuggerRendering has been declared twice in different templates." - this one from cbdebugger

Stack Trace:coldfusion.runtime.CustomException: Error building: myapp.handlers.Security -> Routines cannot be declared more than once. The routine isDebuggerRendering has been declared twice in different templates. with constructor arguments: {controller={[(Component=coldbox.system.web.Controller)]}}

at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142)

at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2795)

at cfBuilder2ecfc204807696$funcBUILDCFC.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\ioc\Builder.cfc:132)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfInjector2ecfc1095079492$funcBUILDINSTANCE.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\ioc\Injector.cfc:288)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfNoScope2ecfc1506373945$funcGETFROMSCOPE.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\ioc\scopes\NoScope.cfc:31)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfInjector2ecfc1095079492$funcGETINSTANCE.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\ioc\Injector.cfc:261)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfHandlerService2ecfc2020012978$funcNEWHANDLER.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\web\services\HandlerService.cfc:120)

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:2655)

at cfHandlerService2ecfc2020012978$funcGETHANDLER.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\web\services\HandlerService.cfc:141)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfController2ecfc800508456$funcRUNEVENT.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\web\Controller.cfc:500)

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.TemplateProxy.invoke(TemplateProxy.java:655)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)

at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)

at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2428)

at cfBootstrap2ecfc707856033$funcPROCESSCOLDBOXREQUEST.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\Bootstrap.cfc:167)

at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)

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:2655)

at cfBootstrap2ecfc707856033$funcONREQUESTSTART.runFunction(C:\ColdFusion10\cfusion\wwwroot\coldbox\system\Bootstrap.cfc:349)

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.CfJspPage._invoke(CfJspPage.java:2428)

at cfApplication2ecfc1322201602$funcONREQUESTSTART.runFunction(C:\ColdFusion10\cfusion\wwwroot\myapp\Application.cfc:60)

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.onRequestStart(AppEventInvoker.java:278)

at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:419)

at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)

at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)

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 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 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.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)

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)

I have tried to replicate and cannot. I have even attached the recipe I used to simulate. You can use it and report back.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

app.boxr (145 Bytes)

I submitted this issue to Brad a couple of weeks ago. It’s likely because you have this setting in your evironment:

    modules.autoReload=true;

When that setting is true the application key for the module mixing isn’t being cleared and the module mixins are being re-appended to the application key.

You can change line 443 in your coldbox.system.FrameworkSupertype to the following to avoid the error:

  /**
  * Load the global application helper libraries defined in the applicationHelper Setting of your application.
  * This is called by the framework ONLY! Use at your own risk
  * @return FrameworkSuperType
  */
  any function loadApplicationHelpers(){
    // Inject global helpers
    var helpers = controller.getSetting( "applicationHelper" );
    var included=[];
    for( var thisHelper in helpers ){
      if(!arrayContains(included,thisHelper)){
        includeUDF( thisHelper );
        arrayAppend(included,thisHelper);
      }
    }

    return this;
  }

Cool, thanks… I will try that

Oh snap-- I’m glad you reminded me Jon. I had completely forgotten to put in the ticket for that.

https://ortussolutions.atlassian.net/browse/CCM-18

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Chad, can you confirm if disabling the modules.autoReload setting fixed your issue?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yes, when I change modules.autoReload = false, all failing modules load up fine (cbcbi18n,cbdebugger,cbcsrf).

Thanks,
Chad

Posted on Slack channel too, but an FYI for someone else if the above setting change didn’t fix your issue as I already had modules.autoReload = false. This cropped back up after removing coldbox and installing coldbox-be. Following a fwreinit=1 it began complaining about

The routine isDebuggerRendering has been declared twice in different templates.

Adding Jon’s snippet above to the framework Supertype didn’t seem to help in my case. It had more to do with component cache checkbox in ACF 11 and clearing the component & template caches to get past the issue.

Hope this helps someone else if they run into a similar issue.

~Tim