ColdBox error with Modules

When the server is restarted, I am always getting this error

Oops! Exception Encountered

Application Execution Exception

Error Type: Expression : [N/A]

Error Messages: Element moduleName is undefined in a CFML structure referenced as part of an expression.

However if I refresh the page again it works fine, it looks like it has something to do with the requestContext, anyone else having this.

Regards,

Andrew Scott

http://www.andyscott.id.au/

I get this too. I have not traced it though and can spend some time
digging up the issue if Luis or anyone else can't replicate.

.brett

I can’t replicate, please investigate and let me know how to fix

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Luis,

I can tell you that you must restart coldfusion and run an event in the module as the very first entyr point, if you need a stack trace I can tell you that it is something in the requestcontext component that is throwing this error.

The error is Line 223 in the web/context/RequestContext.cfc

But you must restart the server and run the very first page request event from the module.

Regards,

Andrew Scott

http://www.andyscott.id.au/

From what I can tell in this example this is on line 223

instance.modules[cModule].layoutSettings.defaultLayout

And it is actually totally emtpy, cmodule contains the actualy name but instance.modules is empty.

Regards,

Andrew Scott

http://www.andyscott.id.au/

It should be noted that changing the application name does the same thing, so you don’t need to restart CF each time.

Regards,

Andrew Scott

http://www.andyscott.id.au/

This only occurs when the setting Modules.AutoReload is set to true.

I have been able to track it down to this setting. I will investigate further.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Ok, found it and fixed it.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

that is as far as I got... then my head exploded :slight_smile:

something that loadColdBox() is doing that moduleService.reloadAll()
isn't, which leaves the modules config empty.

Glad you're on it. Can't wait to see what the fix is.

.brett

Brett, the fix is sooooo idiotic and so brilliant at the same time:

controller.setSetting(“modules”,structnew());

and now instead doing this:

structClear( controller.getSetting(“modules”) );

wow!!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

wow is right, structClear FTW! I'm not sure how long it would of
taken me to get to that. Impressed as always Luis!

thanks,

.brett

Cheers Luis, if you need any help testing then please don’t hesitate to ask.

Regards,

Andrew Scott

http://www.andyscott.id.au/