[mule-user] Please help migrating to Mule 2. Really important

0 views
Skip to first unread message

Nilesh

unread,
Apr 23, 2008, 6:33:22 AM4/23/08
to us...@mule.codehaus.org
Hi,

I use a shared event queue for all my applications. This runs over JMS and uses Mule for delegation. For this Mule 1.4.3 was used since the last 10 months. But since a past few days, mule started ignoring messages if the number of messages goes too high. So I thought of migrating to Mule 2.

I am using ActiveMQ 5. I have attached both the config xmls. When I try to run Mule 2 using the config file, I get this following error message.

ERROR 2008-04-22 11:56:23,662 [JMSMessageSwitchboard.2] org.mule.service.DefaultServiceExceptionStrategy:
********************************************************************************
Message               : Failed to build body from bytes. Reason: java.io.IOException: tv.miniweb.sitecontrol.events.ExportSitesEvent (javax.jms.JMSException)
Type                  : org.mule.api.transformer.TransformerException
Code                  : MULE_ERROR-64999
JavaDoc               : http://mule.mulesource.org/docs/apidocs/org/mule/api/transformer/TransformerException.html
JMS Code              : null
Transformer           : JMSMessageToObject{this=5e8d7d, name='null', ignoreBadInput=false, returnClass=class java.lang.Object, sourceTypes=[interface javax.jms.Message, interface javax.jms.TextMessage, interface javax.jms.ObjectMessage, interface javax.jms.BytesMessage, interface javax.jms.MapMessage, interface javax.jms.StreamMessage]}
********************************************************************************
Exception stack is:
1. tv.miniweb.sitecontrol.events.ExportSitesEvent (java.io.IOException)
  org.apache.activemq.command.ActiveMQObjectMessage:179 (null)
2. Failed to build body from bytes. Reason: java.io.IOException: tv.miniweb.sitecontrol.events.ExportSitesEvent(JMS Code: null) (javax.jms.JMSException)
  org.apache.activemq.util.JMSExceptionSupport:35 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/JMSException.html)
3. Failed to build body from bytes. Reason: java.io.IOException: tv.miniweb.sitecontrol.events.ExportSitesEvent (javax.jms.JMSException) (org.mule.api.transformer.TransformerException)
  org.mule.transport.jms.transformers.AbstractJmsTransformer:150 (http://mule.mulesource.org/docs/apidocs/org/mule/api/transformer/TransformerException.html)
********************************************************************************
Root Exception stack trace:
java.io.IOException: tv.miniweb.sitecontrol.events.ExportSitesEvent
at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:179)
at org.mule.transport.jms.JmsMessageUtils.toObject(JmsMessageUtils.java:159)
at org.mule.transport.jms.transformers.AbstractJmsTransformer.transformFromMessage(AbstractJmsTransformer.java:146)
at org.mule.transport.jms.transformers.JMSMessageToObject.transform(JMSMessageToObject.java:63)
at org.mule.transformer.AbstractMessageAwareTransformer.doTransform(AbstractMessageAwareTransformer.java:68)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:254)
at org.mule.DefaultMuleMessage.applyAllTransformers(DefaultMuleMessage.java:558)
at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:518)
at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:511)
at org.mule.DefaultMuleEvent.transformMessage(DefaultMuleEvent.java:310)
at org.mule.DefaultMuleEvent.transformMessage(DefaultMuleEvent.java:305)
at org.mule.DefaultMuleEventContext.transformMessage(DefaultMuleEventContext.java:93)
at org.mule.component.simple.PassThroughComponent.onCall(PassThroughComponent.java:25)
at org.mule.component.SimpleCallableJavaComponent.invokeComponentInstance(SimpleCallableJavaComponent.java:165)
at org.mule.component.AbstractJavaComponent.doOnCall(AbstractJavaComponent.java:73)
at org.mule.component.AbstractComponent.onCall(AbstractComponent.java:87)
at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:533)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:636)

********************************************************************************

When Mule 2 starts, this is the console out put I get:
**********************************************************************
* Mule ESB and Integration Platform version 1.4.0                    *
* MuleSource, Inc.                                                   *
* For more information go to http://mule.mulesource.org              *
*                                                                    *
* Server started: Tuesday, 22 April 2008 11:52:13 o'clock BST        *
* Server ID: 28e65ebb-105a-11dd-8263-f323d8ed35f1                    *
* JDK: 1.6.0_06 (mixed mode)                                         *
* OS: Linux (2.6.24-16-generic, i386)                                *
* Host: nilesh-laptop (127.0.1.1)                                    *
*                                                                    *
* Agents Running: None                                               *
**********************************************************************

Here I can see no agents running, whereas when I start Mule 1.4, I can see a Mule Admin agent created which accepts connections at tcp://localhost:60504

**********************************************************************
* Mule ESB and Integration Platform version 1.4.3                    *
* MuleSource, Inc.                                                   *
* For more information go to http://mule.mulesource.org              *
*                                                                    *
* Server started: 4/21/08 4:25 PM                                    *
* Server ID: Enterprise-Applications-Mashup                          *
* JDK: 1.6.0_03 (mixed mode)                                         *
* OS: Linux (2.6.18-53.1.13.el5, amd64)                              *
* Host: localhost.localdomain (127.0.0.1)                            *
*                                                                    *
* Agents Running:                                                    *
*   Mule Admin: accepting connections on tcp://localhost:60504       *
**********************************************************************

I get not exceptions when i send messages to Mule 1.4.

Please it would be really helpful if you can tell me what I am missing in the new config file.

Many Thanks,
Nilesh
mule-config-2.0.xml
mule-config-1.4.xml

Travis Carlson

unread,
Apr 23, 2008, 7:01:46 AM4/23/08
to us...@mule.codehaus.org
Nilesh,
Can you please confirm whether you get the same error with ActiveMQ 4?
We don't really support ActiveMQ 5 yet.

> Here I can see no agents running, whereas when I start Mule 1.4, I can
> see a Mule Admin agent created which accepts connections
> at tcp://localhost:60504

The remote admin agent is no longer started by default for 2.0, IIRC.

> Please it would be really helpful if you can tell me what I am missing
> in the new config file.

The config file looks ok to me.

Travis

> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Nilesh

unread,
Apr 23, 2008, 7:43:21 AM4/23/08
to us...@mule.codehaus.org
I get the same error using ActiveMQ 4.

Regards,
Nilesh

Andrew Perepelytsya

unread,
Apr 23, 2008, 8:56:34 AM4/23/08
to us...@mule.codehaus.org
When Mule 2 starts, this is the console out put I get:
**********************************************************************
* Mule ESB and Integration Platform version 1.4.0                    *
* MuleSource, Inc.                                                   *

What is that? You start Mule 2, but get 1.4.0 in runtime? I'd highly recommend you retested with Mule 2.0.1 snapshot available in the downloads (there were critical changes in jms area), but this version mess has to be figured out first before doing anything.

HTH,
Andrew

Nilesh

unread,
Apr 23, 2008, 9:30:00 AM4/23/08
to us...@mule.codehaus.org
Hi,

This was the debug from the tomcat logs when the application starts. The wrong version number was because my project pom had links to 1.4.0. When I change this to 2.0.0-RC1, the application explodes. I can not start my app. This is the error that I get:
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.mule.providers.jms.JmsConnector]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:98)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:807)

Attached is the spring-event.xml file that I am using to configure my web app.

Regards,
Nilesh
spring-event.xml

Andrew Perepelytsya

unread,
Apr 23, 2008, 9:40:08 AM4/23/08
to us...@mule.codehaus.org
First, why use 2.0.0-RC1 when 2.0.0 Final has been officially released? And 2.0.1 SNAPSHOTS are available for download (which you should use for the problem discussed). The config you showed is really configuring Mule 1.x, and I'm totally confused with what you are trying to do now. So, could you?:
  1. Use Mule 2.0.1 in your project
  2. Port the config to 2.0 syntax
That will put us on track.
Andrew

Nilesh

unread,
Apr 23, 2008, 10:30:32 AM4/23/08
to us...@mule.codehaus.org
The porting is where I am having problems. I still don't have the web app side porting sorted.

Please can you tell me what actually is wrong in the config? Why do you think that it is still configured for Mule 1?

Many Thanks.
Nilesh

Andrew Perepelytsya

unread,
Apr 23, 2008, 11:06:37 AM4/23/08
to us...@mule.codehaus.org

Nilesh

unread,
Apr 23, 2008, 11:20:25 AM4/23/08
to us...@mule.codehaus.org
This url below explains me the configuration of the mule server...which I have completed successfully. Configuring my web application is the hurdle that I am stuck on. In my spring-events.xml file, I have defined MuleEventMulticaster and a JMSConnector. But the moment I try to start my spring web app, Tomcat throws this exception:
BeanInstantiationException: Could not instantiate bean class [org.mule.providers.jms.JmsConnector]: Constructor threw exception; nested exception is java.lang.NullPointerException

at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:98)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:807)

I am not using Mule 2.0.0 module jars.

-Nilesh

Andrew Perepelytsya

unread,
Apr 23, 2008, 11:27:14 AM4/23/08
to us...@mule.codehaus.org
With Mule 2 your Mule config *is* a spring config, what you're doing however, is different. You would have both Mule 2 config and Spring beans in the same Mule 2 file and use Mule's webapp listeners to start the app.

Andrew

Nilesh

unread,
Apr 24, 2008, 6:11:19 AM4/24/08
to us...@mule.codehaus.org
Hi,

I have tried to implement something that is explained in this example :http://www.mulesource.org/display/MULEINTRO/Spring+Events+Example

But here while configuring Mule in spring, following code is used:
<bean id="applicationEventMulticaster" class="org.mule.extras.spring.events.MuleEventMulticaster"/>
    <property name="asynchronous"><value>false</value></property>
</bean>
But Mule 2.0.0 libraries do not have this class. The class present is org.mule.module.spring.events.MuleEventMulticaster.  But when I use this class, I get the following exception in tomcat:
10:45:08,922 ERROR ContextLoader:215 - Context initialization failed
java.lang.NullPointerException
at org.mule.module.spring.events.MuleEventMulticaster.getDefaultService(MuleEventMulticaster.java:686)
at org.mule.module.spring.events.MuleEventMulticaster.registerMulticasterComponent(MuleEventMulticaster.java:534)
at org.mule.module.spring.events.MuleEventMulticaster.multicastEvent(MuleEventMulticaster.java:282)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:260)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:744)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:372)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
10:45:08,923 ERROR [/SiteControl]:3768 - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener


Any Idea what would be causing this?

Thanks,
Nilesh

Nilesh

unread,
Apr 24, 2008, 7:47:41 AM4/24/08
to us...@mule.codehaus.org
Hi,

Please can someone tell me how to set MuleContext in MuleEventMulticaster. I am using MuleEventMulticaster in my spring configuration file. Here is the entry
<bean id="applicationEventMulticaster"
class="org.mule.module.spring.events.MuleEventMulticaster">

<property name="asynchronous">
<value>false</value>
</property>
<property name="subscriptions">
<list>
<value>jms://sitecontrol.event.in</value>
</list>
</property>
</bean>

In Mule version 1.4 it was done using this code:
<bean id="muleManager"
class="org.mule.extras.spring.config.AutowireUMOManagerFactoryBean" />

<bean id="muleConfig" class="org.mule.config.MuleConfiguration"
depends-on="muleManager">
<property name="serverUrl" value="" />
</bean>

Any help would be appreciated.

Many thanks,
Nilesh

On Wed, 2008-04-23 at 11:27 -0400, Andrew Perepelytsya wrote:

Daniel Feist

unread,
Apr 24, 2008, 9:48:36 AM4/24/08
to us...@mule.codehaus.org
Hi,

MuleContext should be automatically set on MuleEventMulticaster.

How are you starting Mule? Also are you are using Mule 2.0.0 or not?
(In previous emails you said "I'm not using 2.0.0 module jars")

Dan

Nilesh

unread,
Apr 24, 2008, 10:16:46 AM4/24/08
to us...@mule.codehaus.org
Hi,

I am using Mule 2.0.0. And I am starting mule as a seperate server in a console.

My project initally was referencing wrong jars...which I have corrected now.

Also, on the mulesource site, this page tells me all that I want. The page is called Mule 2.x User guide, but then why is it still referring to classes that are not in Mule 2.x e.g. org.mule.extras.spring.events.MuleEventMulticaster .

When I start my tomcat, I get this Nullpointer exception. Debugging the mule source code pointed out that muleContext variable in the MuleEventMulticaster was null.

Do I have to initialise the mule context?

Nilesh

Daniel Feist

unread,
Apr 24, 2008, 10:41:47 AM4/24/08
to us...@mule.codehaus.org
The mule context is initialised when mule is started, and is then automatically set on the MuleEventMulticaster.

What command are you using to start mule? Is the configuration file you pass as a parameter the same one with the MuleEventMulticaster configured?  You mentioned that was in a seperate webapp before.. how do you start mule in the webapp?

Dan

Nilesh

unread,
Apr 24, 2008, 10:49:24 AM4/24/08
to us...@mule.codehaus.org
I start a standalone instance of Mule using the mule.sh file in the bin directory.

In my web application, I have the spring-events.xml which will configure mule to send and recieve messages from itself.

Attached is the spring-events.xml file. I know I am doing something wrong here with the spring-events.xml file. But this is exactly how Mule 1.4 worked.

-Nilesh
spring-event.xml
Reply all
Reply to author
Forward
0 new messages