3 Replies Latest reply on Apr 21, 2010 10:12 PM by Willem Jiang

    How to handle null response from CXF Provider in Camel Route?

    Gary Motts Novice

      Hi,

       

      If a CXF Provider is configured to point to an endpoint URL that is temporarily unavailable and the Camel route is defined as an ?mep=in-out, an exception is thrown because of course a response is expected and is null.

       

      What is the best way to handle a null response for a CXF Provider?  A custom Fault Interceptor?  Any suggestions on how to implement?

       

      2010-04-19 13:24:27:606 GMT-0400, ERROR, pool-flow.seda.servicemix-cxf-bc-thread-5, org.apache.servicemix.camel.CamelJbiComponent - Error setting exchange status to ERROR

      java.lang.IllegalStateException: component is not owner when trying to set error: java.lang.RuntimeException: javax.jbi.messaging.MessagingException: Fault not supported

           at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)

           at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:550)

           at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)

           at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)

           at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)

           at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)

           at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

           at java.lang.Thread.run(Thread.java:619)

       

      -Thanks

       

      Gary

        • 1. Re: How to handle null response from CXF Provider in Camel Route?
          Willem Jiang Master

          Which version of ServiceMix are you using?

          From the stack trace, I recall we fixed this kind error last year, can you try to use latest ServiceMix 3.4.0.5-fuse or ServiceMix 4.2.0-fuse ?

          • 2. Re: How to handle null response from CXF Provider in Camel Route?
            Gary Motts Novice

            Hi, I was using SM v 3.4.0.4 and just re-tested using SM v3.4.0.5 and no longer get a runtime exception.  Do you happen to recall the SM# which fixed this issue?

             

            Here's my new log entries which is to be expected (unless you know of a better way in Camel handle this?):

             

            2010-04-20 10:17:34:939 GMT-0400, ERROR, pool-flow.seda.servicemix-camel-thread-5, org.apache.camel.processor.DeadLetterChannel - Failed delivery for exchangeId: ID-GMOTTS0705072/3083-1271772821993/0-2. On delivery attempt: 0 caught: org.apache.servicemix.jbi.exception.FaultException: Fault occured for http://www.w3.org/2004/08/wsdl/in-only exchange

            org.apache.servicemix.jbi.exception.FaultException: Fault occured for http://www.w3.org/2004/08/wsdl/in-only exchange

                 at org.apache.servicemix.camel.CamelProviderEndpoint.handleFailure(CamelProviderEndpoint.java:131)

                 at org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:95)

                 at org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:74)

                 at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)

                 at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)

                 at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)

                 at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)

                 at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:632)

                 at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:185)

                 at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)

                 at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)

                 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                 at java.lang.Thread.run(Thread.java:619)

             

            Many Thanks!

             

            Gary

            • 3. Re: How to handle null response from CXF Provider in Camel Route?
              Willem Jiang Master

              I recalled this kind of error was fix durning the servicemix-camel component refactoring.

               

              For you next question, I need to ask your more about it.

              Did you just want to the exception be thrown out or need to leverage camel errorHandler to do the other work?