2 Replies Latest reply on Mar 3, 2012 9:48 AM by fmagdy

    Corrupted JMS Messages when sent from within a BPMN process

    fmagdy

      Hi,

       

      We are using jboss SOA Platform, we are trying to use a bpmn process to read some data from a database and send a JMS message containing some text to a queue in the ESB, but the ESB randomly fails to  de-sterilize some messages, by debugging we found that some messages arrive at the queue corrupted, this happens only when we publish the workflows at the bpmn server (it works perfectly fine with the process running from in the jboss development studio)

      this happens randomly to some messages even if these messages were transmitted correctly before. Any idea what could be the cause of this?

       

      This is the code we use to send the messages

       

       

      public class SendJMSMessage {

      QueueConnection conn;

      QueueSession session;

      Queue que;

       

       

      public void setupConnection() throws JMSException, NamingException

      {

      Properties properties1 = new Properties();

      properties1.put(Context.INITIAL_CONTEXT_FACTORY,

      "org.jnp.interfaces.NamingContextFactory");

      properties1.put(Context.URL_PKG_PREFIXES,

      "org.jboss.naming:org.jnp.interfaces");

      properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");

      InitialContext iniCtx = new InitialContext(properties1);

       

      Object tmp = iniCtx.lookup("ConnectionFactory");

      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

      conn = qcf.createQueueConnection();

        que = (Queue) iniCtx.lookup("queue/ourqueue");

      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      conn.start();

      System.out.println("Connection Started");

      }

       

      public void stop() throws JMSException

      {

      conn.stop();

      session.close();

      conn.close();

      }

       

      public void sendAMessage(String msg) throws JMSException {

       

      QueueSender send = session.createSender(que);       

      ObjectMessage tm = session.createObjectMessage(msg);

       

      send.send(tm);       

      send.close();

      }

       

       

      public void Send(String msg)

      {                   

       

             SendJMSMessage sm = new SendJMSMessage();

             sm.setupConnection();   sm.sendAMessage(msg);

             sm.stop();

            

      }

      }

        • 1. Re: JBPM process sends corrupted JMS Messages
          salaboy21

          Hi,

          First of all, The subject of this topic sounds a little bit strong.. It looks like you are sending the message, not jBPM.

          Who and When the Send() method is called? Can you show us the error? Because if not it's almost impossible to help you.

          Cheers

          • 2. Re: JBPM process sends corrupted JMS Messages
            fmagdy

            Dear Mauricio

             

            Thank you for your reply, I changed the  title to be more relevant  ,  after some more digging, the error now occures in wo cases, first  Is that the message comes corrupted without errors, so the message.getbody().body() is not able to get the message body  so it returns the whole JMS message, the second case is that the queue cant get the message at all and the below error is desplayed at the log of the ESB, the strange thing is that this only happens when the workflow is published, any idea what might be the reason, below is a sample of the messages

             

            the send() method is called from within an action handler of a node in a bpmn process

             

             

            1st case: the message received but message.getbody().body()  cant get the body

            ***************************************************************

            <Envelope><Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsa:To>jms:127.0.0.1:1099#queue/ourqueue</wsa:To><jbossesb:java.naming.factory.initial xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">org.jnp.interfaces.NamingContextFactory</jbossesb:java.naming.factory.initial><jbossesb:java.naming.provider.url xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">127.0.0.1:1099</jbossesb:java.naming.provider.url><jbossesb:java.naming.factory.url.pkgs xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">org.jnp.interfaces</jbossesb:java.naming.factory.url.pkgs><jbossesb:destination-type xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">queue</jbossesb:destination-type><jbossesb:destination-name xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">queue/ourqueue</jbossesb:destination-name><jbossesb:specification-version xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">1.1</jbossesb:specification-version><jbossesb:connection-factory xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">ConnectionFactory</jbossesb:connection-factory><jbossesb:persistent xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">true</jbossesb:persistent><jbossesb:acknowledge-mode xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">AUTO_ACKNOWLEDGE</jbossesb:acknowledge-mode><jbossesb:transacted xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">false</jbossesb:transacted><jbossesb:type xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">urn:jboss/esb/epr/type/jms</jbossesb:type><wsa:MessageID>d14e36a2-d5a1-44a8-bc9f-d9fab4c84423</wsa:MessageID></Header><Context /><Body><Content><Key>b3JnLmpib3NzLnNvYS5lc2IubWVzc2FnZS5kZWZhdWx0RW50cnk=</Key><Value><marshalunmarshal><plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type>rO0ABXQAizxUcmFuc2FjdGlvbj48VHJhbnNhY3Rpb25JZD4zMDg8L1RyYW5zYWN0aW9uSWQ+PFRyYW5zYWN0aW9uTmFtZT5OYW1lPC9UcmFuc2FjdGlvbk5hbWU+PFRyYW5zYWN0aW9uRGF0ZT5udWxsPC9UcmFuc2FjdGlvbkRhdGU+PC9UcmFuc2FjdGlvbj4=</marshalunmarshal></Value></Content></Body><Attachment /><Properties><Property><Key>b3JnLmpib3NzLnNvYS5lc2IubWVzc2FnZS50cmFuc3BvcnQudHlwZQ==</Key><Value>rO0ABX5yAC9vcmcuamJvc3Muc29hLmVzYi5jb21tb24uRW52aXJvbm1lbnQkVHJhbnNwb3J0cwAAAAAAAAAAEgAAeHIADmphdmEubGFuZy5FbnVtAAAAAAAAAAASAAB4cHQAA0pNUw==</Value></Property><Property><Key>amF2YXguam1zLm1lc3NhZ2UucmVkZWxpdmVyZWQ=</Key><Value>rO0ABXNyABFqYXZhLmxhbmcuQm9vbGVhbs0gcoDVnPruAgABWgAFdmFsdWV4cAA=</Value></Property><Property><Key>b3JnLmpib3NzLnNvYS5lc2IubWVzc2FnZS5zb3VyY2U=</Key><Value>rO0ABXQANVBvcnRSZWZlcmVuY2UgPCBqbXM6MTI3LjAuMC4xOjEwOTkjcXVldWUvU1BBUktRdWV1ZSA+</Value></Property><Property><Key>b3JnLmpib3NzLnNvYS5lc2IuZ2F0ZXdheS5vcmlnaW5hbC5xdWV1ZS5uYW1l</Key><Value>rO0ABXQAEHF1ZXVlL1NQQVJLUXVldWU=</Value></Property></Properties></Envelope>

             

             

            Second Case: the message is not received

            ************************************************************************************************************************************************************************************************

            2012-03-03 15:22:01,634 ERROR [org.jboss.internal.soa.esb.couriers.helpers.JmsComposer] (Thread-31) Object in JMS message is not a Serializeable

            java.io.IOException: Util.deserialize caught XMLStreamException

                      at org.jboss.soa.esb.util.Util.deserialize(Util.java:225)

                      at org.jboss.internal.soa.esb.couriers.helpers.JmsComposer.compose(JmsComposer.java:72)

                      at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:461)

                      at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:228)

                      at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:204)

                      at org.jboss.soa.esb.listeners.message.MessageAwareListener.waitForEventAndProcess(MessageAwareListener.java:298)

                      at org.jboss.soa.esb.listeners.message.MessageAwareListener.doRun(MessageAwareListener.java:254)

                      at org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115)

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

            Caused by: javax.xml.stream.XMLStreamException: Unexpected start element: Transaction

                      at org.jboss.internal.soa.esb.util.stax.StreamHelper.checkTag(StreamHelper.java:364)

                      at org.jboss.internal.soa.esb.util.stax.StreamHelper.checkNextStartTag(StreamHelper.java:336)

                      at org.jboss.soa.esb.util.Util.deserialize(Util.java:218)

                      ... 8 more

             

             

             

             

            thanks,

            fmagdy