Flex 2.0 can not load MessageBrokerServlet

I have been playing around with some of the Flex 2.0 examples for ColdFusion. I am trying to get the cfcontact example working and I get the following error when I try to edit the flex-data-service.xml file.

error Could not pre-load servlet: MessageBrokerServlet

I made the following two changes to this file;

<adapters>
<adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
<adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
<adapter-definition id="hibernate" class="flex.data.adapters.HibernateAdapter"/>
<!-- Uncomment this if you want to use the ColdFusion Data Services Adapter -->
<adapter-definition id="coldfusion-dao" class="coldfusion.flex.CFDataServicesAdapter"/>

</adapters>

I also added the destination for the cfcontact;

<destination id="cfcontact">
<adapter ref="coldfusion-dao"/>
<channels>
<channel ref="cf-dataservice-rtmp" />
</channels>
<properties>
<metadata>
<identity property="contactId"/>
</metadata>
<network>
<session-timeout>0</session-timeout>
<paging enabled="false" size="10"/>
<throttle-inbound policy="ERROR" max-frequency="500"/>
<throttle-outbound policy="REPLACE" max-frequency="500"/>
</network>
<server>
<assembler>

<component>samples.contact.ContactAssembler</component>

<hostname>localhost</hostname>

<access>

<method-access-level>remote</method-access-level>
</access>

<property-case>

<force-cfc-lowercase>false</force-cfc-lowercase>

<force-query-lowercase>false</force-query-lowercase>

<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</assembler>


<fill-method>
<name>fill</name>
</fill-method>

<sync-method>
<name>sync</name>
</sync-method>

<get-method>
<name>get</name>
</get-method>

<count-method>
<name>count</name>
</count-method>
</server>
</properties>
</destination>

The only thing I can think of that might be causing a problem is that I am running CF mystic under IIS and Jrun. I have standalone version of jrun Flex data services running on port 8700.

Has anyone found a fix for this yet?

Comments
Mike Rankin's Gravatar I'm still very new at working with CF/Flex, so I can only shed a little light on your issue instead of solving it. I can tell you that I have the exact same setup that you have described and this sample app is running for me.

I have the multi-server developer edition of CF running and going through IIS. I also have FDS on port 8700.

At least, that might help you look in other areas to find the issue.
# Posted By Mike Rankin | 4/18/06 3:27 PM
David Fekke's Gravatar Mike,

Thank you for your Flex experiences. I am running ColdFusion MX 7 under JRun4, but I am running an older version of ColdFusion 6.1 as a Standalone server. Both are setup so I can run them under IIS, but I am just running 7.01. I have the Flex with integrated JRun running, which is a separate version of JRun. I think that might be causing the problem.

Thank you,
David.
# Posted By David Fekke | 4/18/06 4:59 PM
Bernie Lapierre's Gravatar Did you find the reason for this?
I am getting this error starting up my JRun server.
07/13 13:46:00 error Could not pre-load servlet: MessageBrokerServlet
[1]org.apache.commons.logging.LogConfigurationException: org.apache.commons.logg
ing.LogConfigurationException: org.apache.commons.logging.LogConfigurationExcept
ion: Invalid class loader hierarchy. You have more than one version of 'org.apa
che.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.co
mmons.logging.LogConfigurationException: Invalid class loader hierarchy. You ha
ve more than one version of 'org.apache.commons.logging.Log' visible, which is n
ot allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: or
g.apache.commons.logging.LogConfigurationException: Invalid class loader hierarc
hy. You have more than one version of 'org.apache.commons.logging.Log' visible,
which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationExc
eption: Invalid class loader hierarchy. You have more than one version of 'org.
apache.commons.logging.Log' visible, which is not allowed.))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.commons.httpclient.params.DefaultHttpParams.<clinit>(Defau
ltHttpParams.java:53)
at flex.messaging.services.http.HTTPProxyAdapter.<init>(HTTPProxyAdapter
.java:111)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at flex.messaging.util.ClassUtil.createDefaultInstance(ClassUtil.java:71
)
at flex.messaging.Destination.createAdapter(Destination.java:277)
at flex.messaging.Destination.initDestination(Destination.java:103)
at flex.messaging.services.HTTPProxyService.createDestination(HTTPProxyS
ervice.java:78)
at flex.messaging.services.AbstractService.createDestinations(AbstractSe
rvice.java:82)
at flex.messaging.config.MessagingConfiguration.createServices(Messaging
Configuration.java:187)
at flex.messaging.config.MessagingConfiguration.configureBroker(Messagin
gConfiguration.java:84)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:10
5)
at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.
java:1242)
at jrun.servlet.WebApplicationService.preloadServlets(WebApplicationServ
ice.java:789)
at jrun.servlet.WebApplicationService.postStart(WebApplicationService.ja
va:291)
at jrun.deployment.DeployerService.initModules(DeployerService.java:711)

at jrun.deployment.DeployerService.createWatchedDeployment(DeployerServi
ce.java:242)
at jrun.deployment.DeployerService.deploy(DeployerService.java:430)
at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerServi
ce.java:179)
at jrun.deployment.DeployerService.run(DeployerService.java:891)
at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java
:223)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
ava:426)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.comm
ons.logging.LogConfigurationException: Invalid class loader hierarchy. You have
more than one version of 'org.apache.commons.logging.Log' visible, which is not
allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Inval
id class loader hierarchy. You have more than one version of 'org.apache.common
s.logging.Log' visible, which is not allowed.)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:529)
... 30 more
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class l
oader hierarchy. You have more than one version of 'org.apache.commons.logging.
Log' visible, which is not allowed.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:385)
... 31 more
[0]flex.messaging.config.ConfigurationException: Unable to create service 'flex.
messaging.services.HTTPProxyService' for 'proxy-service' due to the following er
ror: org.apache.commons.logging.LogConfigurationException: org.apache.commons.lo
gging.LogConfigurationException: Invalid class loader hierarchy. You have more
than one version of 'org.apache.commons.logging.Log' visible, which is not allow
ed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid cla
ss loader hierarchy. You have more than one version of 'org.apache.commons.logg
ing.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.L
ogConfigurationException: org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy. You have more than one version of 'org.apache.c
ommons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons
.logging.LogConfigurationException: Invalid class loader hierarchy. You have mo
re than one version of 'org.apache.commons.logging.Log' visible, which is not al
lowed.)).
at flex.messaging.config.MessagingConfiguration.createServices(Messaging
Configuration.java:202)
at flex.messaging.config.MessagingConfiguration.configureBroker(Messagin
gConfiguration.java:84)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:10
5)
at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.
java:1242)
at jrun.servlet.WebApplicationService.preloadServlets(WebApplicationServ
ice.java:789)
at jrun.servlet.WebApplicationService.postStart(WebApplicationService.ja
va:291)
at jrun.deployment.DeployerService.initModules(DeployerService.java:711)

at jrun.deployment.DeployerService.createWatchedDeployment(DeployerServi
ce.java:242)
at jrun.deployment.DeployerService.deploy(DeployerService.java:430)
at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerServi
ce.java:179)
at jrun.deployment.DeployerService.run(DeployerService.java:891)
at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java
:223)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
ava:426)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
# Posted By Bernie Lapierre | 7/13/06 3:59 PM
David Fekke's Gravatar I was able to get this working, but I cannot tell you how I did it, becuase it just started working. I have a weird problem with one of my development machines where an instance can be running, but JRun does not see that it is running. I have not tried with the latest versions of Flex and CFMX.

Good luck,
David.
# Posted By David Fekke | 7/13/06 4:21 PM
Kurt Mossman's Gravatar This can happen if you have the default-ear that JRun creates and you install the /samples files for Flex Data Services installed together.

The problem is with the commons-logging.jar. If you copy the commons-logging.properties file from the samples\WEB-INF\flex\jars\commons-logging.properties directory to the samples\WEB-INF\classes\commons-logging.properties directory, it will resolve the problem.

This is listed as Adobe FDS bug: 179227
# Posted By Kurt Mossman | 8/2/06 9:59 AM
Heather Carter's Gravatar Check that the data services config file destination fully quantifies fill parameters.
Ex:
<destination .....>
<fill-method>
<name>searchPorts</name>
<params>java.util.Map</params>
</fill-method>

I am deploying flex on weblogic, and was using daoflex to generate my daos.
It was just populating the params tag with the class.
<params>Map</params>

When I noticed that the MessageBrokerServlet wasn't starting up, it was
complaining about my data adapter and it couldn't find class "Map".
# Posted By Heather Carter | 6/3/07 5:18 PM
Alex's Gravatar http://www.listsofbests.com/list/44908 | http://www.listsofbests.com/list/44906 Very useful information. Thanks. thanks for this guys
# Posted By Alex | 11/21/07 12:00 AM
Junior's Gravatar Hello, I tryed this example and I got the follow error:

Unable to find the ColdFusion Data Management Service in RMI registry on 'localhost:1099'. Flex Data Management support may not be enabled.

Do you know what is it?
Thanks
# Posted By Junior | 1/14/08 6:34 PM
David Fekke's Gravatar Junior,

It sounds like you need make change to one of the config files. It has been over a year since I have worked with LiveCycle or FDS.

Good luck,
David
# Posted By David Fekke | 1/15/08 6:13 AM
Junior's Gravatar I checked the config files and i think that working fine. I have running coldfusion 8 and coldfusion 7, probably it is the problem.
I search information in the web and I found it:

When this error occurs, ColdFusion is unable to start the Flex 2 Assembler service. The error is logged in the cf_root/logs/flex.log file.

but i do not know how I can to repair this?

thanks
# Posted By Junior | 1/15/08 11:55 AM
me's Gravatar Don’t worry, there are some sites that are totally trustworthy. I can think of 3 or 4 that will allow you to download unlimited free PSP games as well as movies and TV shows etc. What’s more, to download free PSP games will be much faster from them. The catch?

http://pspgames247.com
# Posted By me | 7/15/08 5:29 PM
Admin's Gravatar Great point there. So much information is available through Google that it is almost frightening....
# Posted By Admin | 1/4/09 9:30 PM
Admin's Gravatar Thank you so much to everyone for the lovely messages!! It's so cool to hear from our readers :)
http://www.online-flash-game.com/
# Posted By Admin | 1/4/09 9:32 PM
# Posted By Tower Defence | 1/20/09 8:51 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.6.001.