[ 
https://issues.apache.org/activemq/browse/SMXCOMP-638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Giovani Seben updated SMXCOMP-638:
----------------------------------

    Attachment: MOD_testcase.patch
                fix.patch

Attaching two files.
MOD_testcase.patch modifies the JbiInOutCamelErrorHandlingTest to reproduce 
this issue and to use JMSFlow. This is meant to demonstrate the problem only, 
it's not ready to be commited since it disables other tests in the class and 
forces all others to use JmsFlow.

fix.patch is my suggested solution to the NotSerializableException problem. It 
adds a serializable test when copying a camel exchange to a jbi one and 
improves the isSerializable test.

> NotSerializableException with JMSFlow when camel returns an exception. 
> -----------------------------------------------------------------------
>
>                 Key: SMXCOMP-638
>                 URL: https://issues.apache.org/activemq/browse/SMXCOMP-638
>             Project: ServiceMix Components
>          Issue Type: Bug
>          Components: servicemix-camel
>    Affects Versions: servicemix-camel-2009.01
>            Reporter: Giovani Seben
>         Attachments: fix.patch, MOD_testcase.patch
>
>
> In servicemix when a camel route handles an exception that is then returned 
> to the NMR it will attempt to return the exception object with the exchange. 
> Using JMSFlow if the exception object is not serializable, it will fail to be 
> sent back with a NotSerializableException. This is similar to SMXCOMP-18, but 
> instead the problem here happens with the  CamelProviderEndpoint.
> Below is the full exception stack trace:
> {code}
> java.lang.RuntimeException: org.apache.servicemix.camel.JbiExchange 
>         at 
> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:104)
>  
>         at 
> org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:155)
>  
>         at 
> org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:319)
>  
>         at 
> org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:149)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:480)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:435)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:126) 
>         at 
> org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
>  
>         at 
> org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
>  
>         at 
> org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:882)
>  
>         at 
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:396)
>  
>         at 
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:432)
>  
>         at 
> org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:79)
>  
>         at 
> org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:70)
>  
>         at 
> org.apache.servicemix.common.endpoints.SimpleEndpoint.fail(SimpleEndpoint.java:94)
>  
>         at 
> org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:128)
>  
>         at 
> org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:73)
>  
>         at 
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:540)
>  
>         at 
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:492)
>  
>         at 
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
>  
>         at 
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:183)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$401(AbstractJMSFlow.java:63)
>  
>         at 
> org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:517)
>  
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>  
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>  
>         at java.lang.Thread.run(Thread.java:595) 
> Caused by: java.io.NotSerializableException: 
> org.apache.servicemix.camel.JbiExchange 
>         at 
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) 
>         at 
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375) 
>         at 
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347) 
>         at 
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) 
>         at 
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) 
>         at 
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) 
>         at java.util.HashMap.writeObject(HashMap.java:1039) 
>         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:585) 
>         at 
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917) 
>         at 
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339) 
>         at 
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) 
>         at 
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) 
>         at 
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) 
>         at 
> org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:404)
>  
>         at 
> org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
>  
>         at 
> java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310) 
>         at 
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288) 
>         at 
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) 
>         at 
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) 
>         at 
> org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:98)
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to