ColdBox, RequestContextDecorator, WireBox and Event Gateways: Gotcha!

28 views
Skip to first unread message

Aaron Greenlee

unread,
Feb 8, 2012, 4:42:00 PM2/8/12
to col...@googlegroups.com
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)
\lib\frameworks\coldbox35\system\web\services\RequestService.cfc:204
\lib\frameworks\coldbox35\system\web\services\InterceptorService.cfc:131
\lib\frameworks\coldbox35\system\ioc\Injector.cfc:473
\lib\frameworks\coldbox35\system\ioc\scopes\Singleton.cfc:48
\lib\frameworks\coldbox35\system\ioc\Injector.cfc:262
\atvcms\model\asynchronous\Subscriber.cfc:38

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

Hope this helps someone.

Thanks,

Aaron Greenlee

br...@bradwood.com

unread,
Feb 8, 2012, 4:58:50 PM2/8/12
to col...@googlegroups.com
Can you clarify?  Are you saying you updated the value of the requestContextDecorator setting?  What was the pre and post setting?

I'm not too familiar with event gateways, but do they operate outside of your app mappings set up in application.cfc?

Thanks!

~Brad
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Luis Majano

unread,
Feb 8, 2012, 5:39:23 PM2/8/12
to col...@googlegroups.com
Aaron,

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.
--
Reply all
Reply to author
Forward
0 new messages