ColdBox, RequestContextDecorator, WireBox and Event Gateways: Gotcha!

I just found a bug in my application and wanted to advise the community for any others who may cross this path. This is using ColdBox 3.5 bleeding but I suspect it goes back to v3.

In a CMS application I use Event Gateways to kick off a chain of events asynchronously when a record is saved. When the message is received by the subscriber CFC I ask WireBox to grab my models for me so I can get on with my with.

var myModel = application.WireBox.getInstance(model_name);

WireBox starts a whole series of events ending up in the RequestService trying to create the RequestContext object. In my application, it was throwing errors that it could not find my RequestContextDecorator object.

\lib\frameworks\coldbox35\system\web\services\RequestService.cfc:242 (Error Here)

The fix was simple. I added my application mapping to the RequestContextDecorator in my ColdBox.cfc.

Hope this helps someone.


Aaron Greenlee


I run across this using event gateways as well. It seems that mappings get lost for some reason, so creating an object is the issue. I am always pesky on creating the mappings as CF for some reason was not seeing them.

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager: