1 2 Previous Next 19 Replies Latest reply on Jun 20, 2007 4:49 AM by Mark Little

    How to stop the pipeline process and return an error message

    Claudio R Novice

      Hi,

      How to stop the pipeline process and return an error message to sender?
      I have three actions in pipeline: "a" -> "b" -> "c".
      I force a problem in action "b". I wish to return an error message to sender and stop pipeline.
      I tried in method of action b

      message.getFault().setReason("my problem");


      But action "c" is executed nevertheless and in client I got:

      java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImpl
       at org.jboss.internal.soa.esb.message.format.xml.FaultImpl.fromXML(FaultImpl.java:112)
       at org.jboss.internal.soa.esb.message.format.xml.MessageImpl.fromXML(MessageImpl.java:186)
       at org.jboss.soa.esb.util.Util.deserialize(Util.java:214)
       at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:356)
       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223)
       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205)
       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.attemptDelivery(MessageDeliveryAdapter.java:216)
       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:147)
       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
       at com.buscape.TestePipeline.main(TestePipeline.java:25)
      Exception in thread "main" org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message to Service [Cat:Serv]. Check for errors.
       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:156)
       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
       at com.TestePipeline.main(TestePipeline.java:25)


      How can I do this?
      Thanks




        • 1. Re: How to stop the pipeline process and return an error mes
          Mark Little Master

          If you check the 4.2MR2 Programmer's Guide on this subject it'll tell you about Error Handling When Processing Actions. The section before that on Actions, also talks about the ActionProcessingFaultException that can be thrown by Actions to indicate a fault. You can embed your message to be returned within that exception.

          • 2. Re: How to stop the pipeline process and return an error mes
            Claudio R Novice

            Hi Mark Little,

            I had read the topic "Error handling when processing actions" in Programmer´s Guide, but I couldn´t make it work out.
            My code:

            jboss-esb.xml

            <?xml version = "1.0" encoding = "UTF-8"?>
            <jbossesb
             xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
             parameterReloadSecs="5">
             <providers>
             <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost">
             <jms-bus busid="testeEsbChannel">
             <jms-message-filter dest-type="QUEUE"
             dest-name="queue/testee_queue" />
             </jms-bus>
             </jms-provider>
             </providers>
             <services>
             <service category="Cat" name="Serv" description="Grava um endereco no banco">
             <listeners>
             <jms-listener name="testeesbEsbChannel" busidref="testeEsbChannel" maxThreads="1" />
             </listeners>
             <actions>
             <action name="ActionA" class="com.MyAction" process="a"/>
             <action name="ActionB" class="com.MyAction" process="b"/>
             <action name="ActionC" class="com.MyAction" process="c"/>
             </actions>
             </service>
             </services>
            </jbossesb>


            MyAction
            package com;
            
            import org.jboss.soa.esb.helpers.ConfigTree;
            import org.jboss.soa.esb.message.Message;
            import org.jboss.soa.esb.actions.AbstractActionLifecycle;
            import org.jboss.soa.esb.actions.ActionProcessingException;
            import org.jboss.soa.esb.actions.ActionProcessingFaultException;
            
            
            public class MyAction extends AbstractActionLifecycle{
            
             protected ConfigTree _config;
            
             public MyAction(ConfigTree config) {
             _config = config;
             }
            
             public Message noOperation(Message message) {
             return message;
             }
            
             public Message a(Message message) throws Exception {
             System.out.println("executing a");
             String conteudo = new String(message.getBody().getContents());
             conteudo+="a";
             message.getBody().setContents(conteudo.getBytes());
             return message;
             }
            
             public Message b(Message message) throws ActionProcessingException {
            
             //message.getHeader().getCall().setFaultTo(message.getHeader().getCall().getReplyTo());
             message.getFault().setReason("my reason");
             throw new ActionProcessingFaultException(new Exception("my exception"));
             }
            
             public Message c(Message message) throws Exception {
             System.out.println("executing c");
             String conteudo = new String(message.getBody().getContents());
             conteudo+="c";
             message.getBody().setContents(conteudo.getBytes());
             return message;
             }
            
            }

            My java standalone client
            package com;
            
            import org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter;
            import org.jboss.soa.esb.message.Message;
            import org.jboss.soa.esb.message.format.MessageFactory;
            import org.jboss.soa.esb.message.format.MessageType;
            
            public class TestePipeline {
            
             public static void main(String[] args) throws Exception{
            
             MessageDeliveryAdapter deliveryAdapter = new MessageDeliveryAdapter("Cat","Serv");
             MessageFactory mfactory = MessageFactory.getInstance();
            
             Message requestMessage;
             Message replyMessage = null;
            
             // Create and populate the request message...
             requestMessage = mfactory.getMessage(MessageType.JBOSS_XML);
             String teste = "test";
             requestMessage.getBody().setContents(teste.getBytes());
            
             replyMessage = deliveryAdapter.deliverSync(requestMessage, 5000);
             String resp = new String(replyMessage.getBody().getContents());
             System.out.println(resp);
             }
            
            }


            I got the exception in the client:
            java.lang.NullPointerException
             at java.net.URI$Parser.parse(URI.java:3003)
             at java.net.URI.<init>(URI.java:578)
             at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:150)
             at org.jboss.internal.soa.esb.message.format.xml.HeaderImpl.fromXML(HeaderImpl.java:99)
             at org.jboss.internal.soa.esb.message.format.xml.MessageImpl.fromXML(MessageImpl.java:183)
             at org.jboss.soa.esb.util.Util.deserialize(Util.java:214)
             at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:356)
             at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223)
             at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205)
             at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.attemptDelivery(MessageDeliveryAdapter.java:216)
             at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:147)
             at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
             at com.TestePipeline.main(TestePipeline.java:23)
            Exception in thread "main" org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message to Service [Cat:Serv]. Check for errors.
             at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:156)
             at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
             at com.TestePipeline.main(TestePipeline.java:23)


            The execution stop in action b with throw ActionProcessingFaultException, but I don´t receive the error message. I have also tried to setting FaultTo with ReplyTo and got same exception. Am I doing something wrong?
            Thanks!




            • 3. Re: How to stop the pipeline process and return an error mes
              Mark Little Master

              Are you using the code from the trunk of the repository, or the MR2 release?

              • 4. Re: How to stop the pipeline process and return an error mes
                Claudio R Novice

                Hi Mark Little

                I am using code from trunk (12578 - today).

                • 5. Re: How to stop the pipeline process and return an error mes
                  Mark Little Master

                  OK, I'll take a look at this tomorrow.

                  • 6. Re: How to stop the pipeline process and return an error mes
                    Mark Little Master

                    Please try the latest trunk. Looks like someone overwrote an update from earlier in the week that would help in this case.

                    • 7. Re: How to stop the pipeline process and return an error mes
                      Claudio R Novice

                      Hi Mark,

                      I got the last version of the trunk (12613) and the problem persist.
                      I have tried to call esb from webservice in jboss (not standalone).
                      I got this exception in Jboss console

                      10:36:20,015 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline
                      org.jboss.soa.esb.actions.ActionProcessingFaultException: java.lang.Exception: my exception
                       at com.cla.MyAction.b(MyAction.java:32)
                       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 org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.process Methods(ActionProcessorMethodInfo.java:102)
                       at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
                       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:253)
                       at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297)
                       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.lang.Exception: my exception
                       ... 12 more
                      10:36:20,062 ERROR [JmsCourier] Object in JMS message is not a Serializeable
                      java.io.IOException: org.jboss.soa.esb.UnmarshalException: java.lang.NullPointer Exception
                       at org.jboss.soa.esb.util.Util.deserialize(Util.java:229)
                       at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:357)
                       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223)
                       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205)
                       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.attemptDelivery(MessageDeliveryAdapter.java:216)
                       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:147)
                       at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                       at com.buscape.EsbWS.testar(EsbWS.java:37)
                       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 org.jboss.ws.core.server.ServiceEndpointInvokerJSE.invokeServiceEndpointInstance(ServiceEndpointInvokerJSE.java:104)
                       at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
                       at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
                       at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
                       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
                       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                       at java.lang.Thread.run(Thread.java:595)


                      The exception catch in webservice is:

                      10:36:20,062 ERROR [STDERR] org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message to Service [MinhaCategoria:MeuServico]. Check for errors.
                      10:36:20,062 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:156)
                      10:36:20,062 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                      10:36:20,062 ERROR [STDERR] at com.buscape.EsbWS.testar(EsbWS.java:37)
                      10:36:20,062 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      10:36:20,062 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      10:36:20,062 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      10:36:20,062 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpointInvokerJSE.invokeServiceEndpointInstance(ServiceEndpointInvokerJSE.java:104)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
                      10:36:20,062 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                      10:36:20,062 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
                      10:36:20,062 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      10:36:20,062 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                      10:36:20,062 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                      10:36:20,062 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                      10:36:20,062 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      10:36:20,062 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                      10:36:20,062 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                      10:36:20,062 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                      10:36:20,062 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      10:36:20,062 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


                      Am I doing something wrong?
                      Thanks

                      • 8. Re: How to stop the pipeline process and return an error mes
                        Mark Little Master

                        If we go back to your original question "how to stop the pipeline proces", then in the first stack trace you get:

                        WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline
                        


                        This shows that the ESB has caught your application exception thrown from the Action process. After printing out the warning and doing exception notification, it then checks the type of exception you've thrown. BTW, by this point, the action chain processing has halted, so if you had other actions in the chain after this one, they wouldn't get called.

                        If the exception you thrown is an ActionProcessingException then the ESB will create a fault message from the contents (if there are any) and send this to the recipient dictated by the fault handling rules (discussed in the documentation).

                        If it's not an ActionProcessingException that is thrown, then the ESB will try to construct some sensible default error message and return that.

                        I have some ideas about the NPE and your error in the Web Service, but in order to be sure I've improved the error handling a bit in those areas. Can you try again with the latest trunk and post the resulting traces?

                        • 9. Re: How to stop the pipeline process and return an error mes
                          Claudio R Novice

                          Hi Mark,

                          I am using this method to stop pipeline

                          public Message b(Message message) throws Exception {
                          
                           throw new ActionProcessingException(new Exception("my exception"));
                          }


                          I got the last version of trunk (12654).
                          With this version, I got

                          Exception catch in client standalone

                          Exception in thread "main" org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message to Service [Cat:Serv]. Check for errors.
                           at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:156)
                           at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                           at com.TestePipeline.main(TestePipeline.java:23)


                          Exception in console jboss (version client standalone)

                          13:44:30,421 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline
                          org.jboss.soa.esb.actions.ActionProcessingException: java.lang.Exception: my exception
                           at com.MyAction.b(MyAction.java:45)
                           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 org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
                           at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
                           at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:253)
                           at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297)
                           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.lang.Exception: my exception
                           ... 12 more


                          Exception catch in webservice´s method

                          14:14:30,937 ERROR [STDERR] org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message to Service [MinhaCategoria:MeuServico]. Check for errors.
                          14:14:30,937 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:156)
                          14:14:30,937 ERROR [STDERR] at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                          14:14:30,937 ERROR [STDERR] at com.buscape.EsbWS.testar(EsbWS.java:37)
                          14:14:30,937 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          14:14:30,937 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                          14:14:30,953 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          14:14:30,953 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpointInvokerJSE.invokeServiceEndpointInstance(ServiceEndpointInvokerJSE.java:104)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
                          14:14:30,953 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                          14:14:30,953 ERROR [STDERR] at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
                          14:14:30,953 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          14:14:30,953 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                          14:14:30,953 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                          14:14:30,953 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                          14:14:30,953 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                          14:14:30,953 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                          14:14:30,953 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                          14:14:30,953 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                          14:14:30,953 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                          14:14:30,953 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


                          Exception in console jboss (version webservice)

                          14:14:30,921 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline org.jboss.soa.esb.actions.ActionProcessingException: java.lang.Exception: my exception
                           at com.cla.MyAction.b(MyAction.java:32)
                           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 org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
                           at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
                           at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:253)
                           at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:297)
                           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.lang.Exception: my exception
                           ... 12 more
                          14:14:30,937 ERROR [JmsCourier] Object in JMS message is not a Serializeable java.io.IOException: Util.deserialize caught UnmarshalException
                           at org.jboss.soa.esb.util.Util.deserialize(Util.java:231)
                           at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:357)
                           at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223)
                           at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205)
                           at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.attemptDelivery(MessageDeliveryAdapter.java:216)
                           at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:147)
                           at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                           at com.buscape.EsbWS.testar(EsbWS.java:37)
                           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 org.jboss.ws.core.server.ServiceEndpointInvokerJSE.invokeServiceEndpointInstance(ServiceEndpointInvokerJSE.java:104)
                           at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
                           at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
                           at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
                           at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                           at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
                           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                           at java.lang.Thread.run(Thread.java:595)
                          Caused by: org.jboss.soa.esb.UnmarshalException: java.lang.NullPointerException
                           at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:159)
                           at org.jboss.internal.soa.esb.message.format.xml.HeaderImpl.fromXML(HeaderImpl.java:107)
                           at org.jboss.internal.soa.esb.message.format.xml.MessageImpl.fromXML(MessageImpl.java:190)
                           at org.jboss.soa.esb.util.Util.deserialize(Util.java:226)
                           ... 37 more
                          Caused by: java.lang.NullPointerException
                           at java.net.URI$Parser.parse(URI.java:3003)
                           at java.net.URI.<init>(URI.java:578)
                           at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:150)
                           ... 40 more


                          I think in both cases the org.jboss.soa.esb.listeners.message.MessageDeliverException is masking the org.jboss.soa.esb.actions.ActionProcessingException

                          How can I get the first exception? (In webservice case, I tried to use ex.getCause(), but I got null)
                          How can I get the error message if a exception is throw in deliveryAdapter.deliverSync(requestMessage, 5000)?
                          Thanks

                          • 10. Re: How to stop the pipeline process and return an error mes
                            Mark Little Master

                            Try changing your throw of ActionProcessingException to ActionProcessingFaultException. With that exception you'll be able to specify the fault Message that will go back to the failure recipient. Give that a go first as I think that's a better match for what you want to accomplish.

                            • 11. Re: How to stop the pipeline process and return an error mes
                              Claudio R Novice

                              Hi Mark,

                              I changed to ActionProcessingFaultException, but in webservice and client I got the same exception (org.jboss.soa.esb.listeners.message.MessageDeliverException).
                              I see in server log this exception after my exception

                              2007-06-18 16:26:27,359 ERROR [org.jboss.internal.soa.esb.couriers.JmsCourier] Object in JMS message is not a Serializeable
                              java.io.IOException: Util.deserialize caught UnmarshalException
                               at org.jboss.soa.esb.util.Util.deserialize(Util.java:231)
                               at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:357)
                               at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223)
                               at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205)
                               at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.attemptDelivery(MessageDeliveryAdapter.java:216)
                               at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliver(MessageDeliveryAdapter.java:147)
                               at org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter.deliverSync(MessageDeliveryAdapter.java:109)
                               at com.buscape.EsbWS.testar(EsbWS.java:37)
                               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 org.jboss.ws.core.server.ServiceEndpointInvokerJSE.invokeServiceEndpointInstance(ServiceEndpointInvokerJSE.java:104)
                               at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:207)
                               at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
                               at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
                               at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
                               at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                               at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
                               at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                               at java.lang.Thread.run(Thread.java:595)
                              Caused by: org.jboss.soa.esb.UnmarshalException: java.lang.NullPointerException
                               at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:159)
                               at org.jboss.internal.soa.esb.message.format.xml.HeaderImpl.fromXML(HeaderImpl.java:107)
                               at org.jboss.internal.soa.esb.message.format.xml.MessageImpl.fromXML(MessageImpl.java:190)
                               at org.jboss.soa.esb.util.Util.deserialize(Util.java:226)
                               ... 37 more
                              Caused by: java.lang.NullPointerException
                               at java.net.URI$Parser.parse(URI.java:3003)
                               at java.net.URI.<init>(URI.java:578)
                               at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:150)
                               ... 40 more


                              It seems that ESB tried to send back message, but occured a problem (Object in JMS message is not a Serializeable)
                              Could this cause the org.jboss.soa.esb.listeners.message.MessageDeliverException in webservice and client?

                              • 12. Re: How to stop the pipeline process and return an error mes
                                Mark Little Master

                                 

                                Caused by: java.lang.NullPointerException
                                 at java.net.URI$Parser.parse(URI.java:3003)
                                 at java.net.URI.<init>(URI.java:578)
                                 at org.jboss.internal.soa.esb.addressing.helpers.CallHelper.fromXML(CallHelper.java:150)
                                


                                indicates that the RelatesTo field in the message is null. That shouldn't be the case: it's illegal to say that there's a RelatesTo and then not set it. I assume you don't try to assign this within the Message you try to return within the fault?

                                • 13. Re: How to stop the pipeline process and return an error mes
                                  Kevin Conner Master

                                  Claudio, there was an error in the serialisation of RelatesTo header elements.

                                  Can you please update your source and try again?

                                  Thanks

                                  • 14. Re: How to stop the pipeline process and return an error mes
                                    Claudio R Novice

                                    Hi Kevin,

                                    What I must update? (Update my code or update esb svn?)
                                    I changed the exception

                                    throw new ActionProcessingFaultException("my exception");


                                    to

                                    throw new ActionProcessingFaultException(message,"my exception");


                                    And I got the error message.
                                    What I was doing wrong?
                                    Thanks.


                                    1 2 Previous Next