You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jamie McCrindle <ja...@gmail.com> on 2006/03/28 12:16:18 UTC

ClassLoader questions

hi,

i'm trying out the following setup:

sm container in a web app <- jmsflow -> sm with deployed components

but i'm having a few classloader issues, specifically: JMS Flow throws
no class def found errors on objects coming out of the web
application.

i.e. this error:

ERROR - JMSFlow.onMessage(467) | Caught an exception unpacking JMS Message:
javax.jms.JMSException: Failed to build body from bytes. Reason: java.io.IOExcep
tion: org.bpmscript.Query
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
rt.java:32)
        at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQO
bjectMessage.java:171)
        at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.onMessage(JMSFlow.java
:442)
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageC
onsumer.java:715)
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionE
xecutor.java:93)
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionEx
ecutor.java:146)

(the NCDF is put into an IOException).

i've tried a few things. since i have several components that need to
be deployed, i'm using the servicemix-lwcontainer.

my su contains a all the relevent jar files and a classpath\location
for each of them in the servicemix.xml file in the su.

i'm assuming the no class def found is because the jms flow is kicking
in with a higher level classloader. outside of serializing all my data
across the bus using xstream, i'm not sure how to proceed.

any suggestions?
regards,
Jamie.

Re: ClassLoader questions

Posted by Guillaume Nodet <gn...@gmail.com>.
I see two solutions:
  * only put in the exchange objects that are known to the container
classloader
  * put the needed jars in the container classloader

If you serialize data using xstream, you may want to put the
serialized form in the exchange instead of using the object.

Cheers,
Guillaume Nodet

On 3/28/06, Jamie McCrindle <ja...@gmail.com> wrote:
> hi,
>
> i'm trying out the following setup:
>
> sm container in a web app <- jmsflow -> sm with deployed components
>
> but i'm having a few classloader issues, specifically: JMS Flow throws
> no class def found errors on objects coming out of the web
> application.
>
> i.e. this error:
>
> ERROR - JMSFlow.onMessage(467) | Caught an exception unpacking JMS Message:
> javax.jms.JMSException: Failed to build body from bytes. Reason: java.io.IOExcep
> tion: org.bpmscript.Query
>         at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
> rt.java:32)
>         at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQO
> bjectMessage.java:171)
>         at org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.onMessage(JMSFlow.java
> :442)
>         at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageC
> onsumer.java:715)
>         at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionE
> xecutor.java:93)
>         at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionEx
> ecutor.java:146)
>
> (the NCDF is put into an IOException).
>
> i've tried a few things. since i have several components that need to
> be deployed, i'm using the servicemix-lwcontainer.
>
> my su contains a all the relevent jar files and a classpath\location
> for each of them in the servicemix.xml file in the su.
>
> i'm assuming the no class def found is because the jms flow is kicking
> in with a higher level classloader. outside of serializing all my data
> across the bus using xstream, i'm not sure how to proceed.
>
> any suggestions?
> regards,
> Jamie.
>