Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-638

NotSerializableException with JMSFlow when camel returns an exception.

    XMLWordPrintableJSON

    Details

    • Patch Info:
      Patch Available

      Description

      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:

      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)
      

        Attachments

        1. fix.patch
          2 kB
          Giovani Seben
        2. JbiCamelExceptionsTest.java
          4 kB
          Gert Vanthienen
        3. MOD_testcase.patch
          7 kB
          Giovani Seben
        4. smxcomp638.patch
          2 kB
          Giovani Seben
        5. SMXCOMP-638.patch
          18 kB
          Willem Jiang
        6. smxcomp-638-new.patch
          26 kB
          Willem Jiang

          Activity

            People

            • Assignee:
              gertvanthienen Gert Vanthienen
              Reporter:
              gseben Giovani Seben
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: