Hello all,
I've stepped up to CB 4.0 and the transition has been relatively smooth. But I'm having trouble getting modules to work correctly -- currently I am trying to get cbstorages and cbdebugger to work correctly. I'm working on a windows server 2012 machine, running Railo 4, with MySQL.
First, in all of the templates that come with Cb 4.0, there isn't a "modules" folder to put anything in. So I simply made one, and that seems to work. But for us fools, it might be better to just put one in the Advanced / Adv Script templates with a "PutStuffHere.txt" file.
cbstorages
I dropped the cbstorages folder into the modules folder, and it appears to load (as it appears in getSetting("Modules") when I loop through it). It works absolutely fine in my handlers, whether I inject it via WireBox as a property or use getModel("sessionStorage@cbstorages"). But, when I try to use it in an interceptor, injecting it fails. I try to do this:
component accessors=true output=false singleton extends="coldbox.system.Interceptor" {
property name="SecurityService" inject="SecurityService_tag"; <-- this is my own service, it works fine.
property name="SS" inject="sessionStorage@cbstorages";
... and I get this error:
Railo 4.2.1.000 Error (Builder.DSLDependencyNotFoundException) |
Message | The DSL Definition {REF={null}, REQUIRED={true}, ARGNAME={}, DSL={id:sessionStorage@cbstorages}, JAVACAST={null}, NAME={SS}, TYPE={any}, VALUE={null}, SCOPE={variables}} did not produce any resulting dependency |
Detail | The target requesting the dependency is: 'interceptor-SecurityInterceptor' |
I've tried multiple namespace edits and nothing seems to work. But:
Interestingly, if I instead create a reference via
var SessionStorage=getModel("SessionStorage@cbstorages");
it works just fine. I'm trying to understand if this is "expected behavior" and has something to do with the timing of interceptor creation, or if I'm doing something wrong, or have some setting off. The interceptor otherwise behaves perfectly, and I've registered it in Coldbox.cfc.
cbdebugger
This has been more of a challenge, and I have yet to make it work. I dropped the whole folder into "modules" of my application, and it loads correctly per the getSetting("modules") loop in the template default view. When I reinit the framework, I first get this error:
Railo 4.2.1.000 Error (Controller.SettingNotFoundException) |
Message | The setting ApplicationHelper does not exist. |
Detail | FWSetting flag is false
|
Googling this, it appears (please correct me if I'm wrong) that somewhere in the CB 3.8 -> 4.0 transition, the UDFLibraryFile setting in Coldbox.cfc was deprecated for ApplicationHelper which is an array of UDF files to include. But there is no such setting in the ColdBox.cfc file that I can see. So, I added a setting to the ColdBox.cfc file like so:
ApplicationHelper = ["includes/helpers/ApplicationHelper.cfm"],
...and adding this made that error resolve. But no matter what I have tried next, I can't get the debugger to work. I've tried (one at a time):
property name="debug" inject="debuggerService@cbdebugger";
and
var cbdebugger=getInstance("debuggerService@cbdebugger");
var cbdebugger=getModel("debuggerService@cbdebugger");
and tried not injecting it at all, and then tried multiple combinations of:
showDebugger();
cbdebugger.showDebugger();
and all of them throw errors that the function or property doesn't exist. It seems that the mixins.cfm file that's part of the cbdebugger module isn't getting loaded correctly. I opened that and saw that the showDebugger() function just sets a variable in the prc, so I tried just doing that in my handler, and that gives me this error:
Oopsy! An Exception Was Encountered
Error Type: expression : 0
Error Messages: No matching function [ISDEBUGGERRENDERING] found
Tag Context:
ID: ??
LINE: 77
Template: /NIS2/modules/cbdebugger/interceptors/Debugger.cfc
ID: ??
LINE: 370
Template: /coldbox/system/web/context/InterceptorState.cfc
ID: ??
LINE: 260
Template: /coldbox/system/web/context/InterceptorState.cfc
ID: ??
LINE: 121
Template: /coldbox/system/web/context/InterceptorState.cfc
ID: ??
LINE: 139
Template: /coldbox/system/web/services/InterceptorService.cfc
ID: ??
I've run out of ideas, hoping I'm doing something really dumb that would be easy to fix. Crazy situation is that at present, the rest of my code works fine so I don't need the debugger, but I expect it will come in handy in the near future. Thanks for any insight!