servicemix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gert Vanthienen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (SMXCOMP-638) NotSerializableException with JMSFlow when camel returns an exception.
Date Mon, 09 Nov 2009 11:16:52 GMT

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

Gert Vanthienen updated SMXCOMP-638:
------------------------------------

    Attachment: JbiCamelExceptionsTest.java

Using the patches provided will convert all exceptions into a JBI-specific exception type
-- up to now, we just conveyed these back in the original type (as shown in the first test
in the attached JbiCamelExceptionsTest), allowing us to handle it in a Camel route (as shown
in the second test).

Considering that all exceptions implement the Serializable interface so they're supposed to
be serializable, I would suggest we keep this behavior as the default as I think a lot of
people are relying on this when they are using Camel for defining exception handling inside
servicemix.

However, to handle this scenario with non-serializable exceptions and properties, I would
like to suggest we add two optional flags to the endpoint:
- *{{convertExceptions}}* to convert all exceptions in a JB-specific exception type, so people
can use this to handle non-serializable exceptions
- *{{serialization=strict}}* to perform a strict serialiation check (by attempting the write
to a byte array output stream as suggested earlier by Giovani

Wdyt?

> 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
>            Assignee: Gert Vanthienen
>         Attachments: fix.patch, JbiCamelExceptionsTest.java, MOD_testcase.patch, SMXCOMP-638.patch,
smxcomp638.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.


Mime
View raw message