I have been a huge fan of BlazeDS ever since Adobe MAX 2009 where I attended a BYOL session given by Aaron West.  However, I have never had a production use for it.  I have always been looking for a way to use it but nothing ever cam up.  Then recently we wanted to replace the alert system in our system with something more real-time.  This was a perfect opportunity to use BlazeDS.

The only issue we had was our system was still running ColdFusion 8.  BlazeDS was baked into ColdFusion 9.  ColdFusion 8 uses LCDS.  So I did some digging and found a presentation from Aaron on getting BlazeDS working inside ColdFusion 8.  What this basically does is replace LCDS with BlazeDS.  Since I was not using LCDS this would not be an issue.

So, a about a month ago I tackled getting it running on our development server.  The install was a breeze.  Aaron's video walk though was perfect and allowed me to follow right along.  After only a few minutes I was able to get it all running.  I ran into a couple configuration issues but with some assistance from Aaron those were quickly worked out.

Fast forward to now.  Using the same steps from installing BlazeDS on our dev server I went about getting it running in test.  This time I ran into a major issue that kept BlazeDS from running.  ColdFusion was throwing the following error when trying to start up after getting BlazeDS in place.

03/21 08:29:49 user MessageBrokerServlet: init
[BlazeDS]BlazeDS - Community Edition:
[BlazeDS]No login command was found for 'JRun/4.0'. Please ensure that
the login-command tag has the correct server attribute value, or use
'all' to use the login command regardless of the server.
[BlazeDS]Endpoint cf-longpolling-amf created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/flex2gateway/cfamflongpolling
[BlazeDS]Endpoint my-amf created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/amf
**** MessageBrokerServlet failed to initialize due to runtime
exception:   Exception: flex.messaging.MessageException: Cannot create
class of type 'coldfusion.flex.CFEventGatewayAdapter'. Type
'coldfusion.flex.CFEventGatewayAdapter' not found.
       at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:66)
       at flex.messaging.Destination.createAdapter(Destination.java:337)
       at flex.messaging.config.MessagingConfiguration.createAdapter(MessagingConfiguration.java:372)
       at flex.messaging.config.MessagingConfiguration.createDestination(MessagingConfiguration.java:364)
       at flex.messaging.config.MessagingConfiguration.createServices(MessagingConfiguration.java:332)
       at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:100)
       at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:129)
       at coldfusion.flex.ColdFusionMessageBrokerServlet.init(ColdFusionMessageBrokerServlet.java:24)


Basically, what this error means is that one of the jars could not be found.  Also, this error didn't prevent ColdFusion from starting.

So, after searching the interwebs I asked Aaron if he had seen this before.  After some back and forth this issue was new to Aaron as well. 

For some reason this server wanted some of the jars to be in a different place then the instructions stated.  This seemed strange since both servers were installed with the same features and both running the same OS (win2003 ent).

Here I spent a while trying to see if maybe the jars were corrupt or there were permissions issues.  None of these worked out.  What ended up working as a based on pure luck and a guess.

What was hanging it up was the placement of 2 jars and where they resided.  The instructions state to put 2 jars from the BlazeDS install here: {CF_install_dir}/wwwroot/WEB-INF/flex/jars.  The jars in question are cfgatewayadapter.jar and concurrent.jar. 

I ended up taking those 2 jars and placeing them here: {CF_install_dir}/lib . 

Once I did that ColdFusion would start without error.  Then ran some sample code I had and BlazeDS was working perfectly. 

I have not been able to determine why this server had to be configured this way.  Nor did I find any documentation supporting this change as they way it should be done.

So there you have it.  I hope that this may help someone if they run into this issue.

Till next time,