6 Replies Latest reply on Dec 21, 2007 2:38 PM by Vinicius Carvalho

    Can't send  JMS messages to gateway

    Vinicius Carvalho Apprentice

      Hello there! I've setup an ESB deployment where we receive messages through SOAP and JMS. The soap adapter is working fine. But when I try to send jms messages to my gateway queue, It takes over 2 minutes and the message is never sent. I need to cancel the unit test and then I get an error from the jboss messaging stack. Here's my config files:

      jboss-esb (I've removed a few services...)

      <?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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd jbossesb-1.0.1.xsd ">
      <providers>
       <jms-provider name="jmsProvider" connection-factory="ConnectionFactory"
       jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
       jndi-URL="localhost">
       <jms-bus busid="Gateway">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/InboundQueue"/>
       </jms-bus>
       <jms-bus busid="ESBChannel">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBChannel"/>
       </jms-bus>
      
      
       </jms-provider>
      
       <jbr-provider name="JBR-Http" protocol="http" host="localhost">
       <jbr-bus busid="Http-1" port="8865" />
       </jbr-provider>
       <jbr-provider name="JBR-Socket" protocol="socket" host="localhost">
       <jbr-bus busid="Socket-1" port="8788" />
       </jbr-provider>
      
      </providers>
      <services>
      <service name="InboudService" description="Servico de entrada" category="InboundServices">
       <listeners>
       <jms-listener name="inboundListener" busidref="Gateway" is-gateway="true" maxThreads="1"/>
       <jms-listener name="JMS-ESB-Listener" busidref="ESBChannel" is-gateway="false" maxThreads="1">
       </jms-listener>
       <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
       <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true" maxThreads="1"/>
       </listeners>
       <actions>
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
       </action>
       <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
       <property name="jbossws-endpoint" value="MyService"/>
       </action>
       <action name="CallEJB" class="com.acme.actions.EjbCallerAction" process="callEJB"></action>
       <action name="ContentBasedRouter" class="org.jboss.soa.esb.actions.ContentBasedRouter">
       <property name="ruleSet" value="contentRouter.drl"/>
       <property name="ruleLanguage" value="XPathLanguage.dsl"/>
       <property name="ruleReload" value="true"/>
       <property name="destinations">
       <route-to destination-name="CadastroCliente" service-category="Cliente" service-name="ClienteService"/>
       <route-to destination-name="RemocaoCliente" service-category="Cliente" service-name="ClienteService"/>
      
       </property>
      
       <property name="object-paths">
       <object-path esb="body.BODY_CONTENT"/>
       </property>
       </action>
       </actions>
      </service>
      
      </services>
      </jbossesb>
      
      


      my junit test code:
      private static ConnectionFactory cf;
       private static Queue targetQueue;
      
       @BeforeClass
       public static void setup(){
       try {
       InitialContext ctx = new InitialContext();
       cf = (ConnectionFactory) ctx.lookup("ConnectionFactory");
       targetQueue = (Queue)ctx.lookup("queue/CSMInboundQueue");
       } catch (NamingException e) {
       e.printStackTrace();
       }
      
       }
      
       @Test
       public void testReservaIP() throws Exception{
       Connection conn = null;
       try{
       conn = cf.createConnection();
       Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       conn.start();
       MessageProducer producer = session.createProducer(targetQueue);
       TextMessage message = session.createTextMessage();
       message.setText(loadText("payload.xml");
       producer.send(message);
       producer.close();
       }catch (Exception e) {
      
       }finally{
       conn.stop();
       conn.close();
       }
      
       }
      
      


      Well, it get stuck on the send part, and the ESB does not get the message at all. Am I missing something here?

      Best regards

        • 1. Re: Can't send  JMS messages to gateway
          Kurt Stam Master

          Can you try running the helloworld quickstart? It has a very similar setup. --Kurt

          • 2. Re: Can't send  JMS messages to gateway
            Vinicius Carvalho Apprentice

            Sure :)
            I've ran both quickstart and dynamic_router and both can not send messages: Here's an output of the run window and runtest window:

            run

            vinicius@cybertron:/java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld$ ant run
            Buildfile: build.xml
            
            check-jbossesb-dist:
            
            qslib-dependencies:
            
            non-qslib-dependencies:
            
            jbossesb-dependencies:
            
            jbossesb-server-dependencies:
            
            messaging-config:
            
            messaging-dependencies:
            
            jbossmq-dependencies:
            
            quickstart-specific-dependencies:
            
            dependencies:
            
            compile:
             [mkdir] Created dir: /java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld/build/classes
             [javac] Compiling 3 source files to /java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld/build/classes
             [javac] /java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendEsbMessage.java:53: warning: [deprecation] setByteArray(byte[]) in org.jboss.soa.esb.message.Body has been deprecated
             [javac] esbMessage.getBody().setByteArray(args[2].getBytes());
             [javac] ^
             [javac] 1 warning
            
            config:
            
            run:
             [echo] Launching Quickstart in standalone mode...
             [qsjava] +----------------------------------------------------------+
             [qsjava] | |
             [qsjava] | Starting JBossESB... |
             [qsjava] | |
             [qsjava] +----------------------------------------------------------+
             [qsjava] Reading config from /java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld/jboss-esb.xml
             [qsjava] 12:46:07,410 INFO [main][SimpleThreadPool] Job execution threads will use class loader of thread: main
             [qsjava] 12:46:07,430 INFO [main][QuartzScheduler] Quartz Scheduler v.1.5.2 created.
             [qsjava] 12:46:07,432 INFO [main][RAMJobStore] RAMJobStore initialized.
             [qsjava] 12:46:07,433 INFO [main][StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from an externally provided properties instance.
             [qsjava] 12:46:07,433 INFO [main][StdSchedulerFactory] Quartz scheduler version: 1.5.2
             [qsjava] 12:46:10,657 INFO [main][QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
            
            


            runtest
            vinicius@cybertron:/java/servers/jbossesb-4.2.1GA/samples/quickstarts/helloworld$ ant runtest
            Buildfile: build.xml
            
            check-jbossesb-dist:
            
            qslib-dependencies:
            
            non-qslib-dependencies:
            
            jbossesb-dependencies:
            
            jbossesb-server-dependencies:
            
            messaging-config:
            
            messaging-dependencies:
            
            jbossmq-dependencies:
            
            quickstart-specific-dependencies:
            
            dependencies:
            
            compile:
            
            runtest:
             [echo] Runs Test JMS Sender
             [java] Connection Started
            
            


            Just a question:

            In the run window, is that the final message? I mean was it really initialized correctly?

            The second window remains on "Connection Started" for a loooong time, only when I kill the process and by doing this, I get the same exception from jboss-,messaging:

            12:50:29,382 ERROR [ServerThread] failed
            java.io.IOException
             at java.io.DataInputStream.readFully(DataInputStream.java:178)
             at java.io.DataInputStream.readLong(DataInputStream.java:380)
             at org.jboss.jms.wireformat.SessionSendRequest.read(SessionSendRequest.java:80)
             at org.jboss.jms.wireformat.JMSWireFormat.read(JMSWireFormat.java:298)
             at org.jboss.remoting.transport.socket.ServerThread.versionedRead(ServerThread.java:652)
             at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:530)
             at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:383)
             at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
            12:51:07,297 WARN [SimpleConnectionManager] A problem has been detected with the connection to remote client 3j011-ttw737-fagwb1pi-1-fagwb23m-4, jmsClientID=9-z62bwgaf-1-ip1bwgaf-737wtt-110j3. It is possible the client has exited without closing its connection(s) or the network has failed. All connection resources corresponding to that client process will now be removed.
            


            Also, I would like to mention, that I can't just cancel the first window, it hangs on the "Stopping JBossESB" message.

            Well, I've followed the readme instructions step by step. Ran the install script in a fresh jboss 4.2.0.GA installation. Ran the server and then the samples.

            Any ideas of why is this happening?

            Best regards



            • 3. Re: Can't send  JMS messages to gateway
              Vinicius Carvalho Apprentice

              Looking at this post http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126373
              I've found some tips about libs version problems (both jboss-remoting and jboss-messaging). So I've copied the ones from the jboss server to $ESB_HOME/lib/ext and yet I still have the same hanging problem.
              I'm wondering what is the correct version of libs/server/messaging/ws to use with ESB and getting it running ...

              • 4. Re: Can't send  JMS messages to gateway
                Vinicius Carvalho Apprentice

                Well, it is really a problem with versions. I've just downloaded the esb-server bundle (instead of installing it on a jboss 4.2.0 server) and the quickstarts samples are working fine.

                I'm a little affraid since I need to have communication with other jboss' servers with different versions (I'll be using a bridge for that)

                Regards

                • 5. Re: Can't send  JMS messages to gateway
                  Kurt Stam Master

                  Hi viniciuscarvalho,

                  Sorry to see you in version hell. We are always a few steps behind the appserver since we have to do our testing on it. So we are currently on 4.2.1.

                  That said going forward we will hopefully will hopefully be able to use the new 5.0 kernel soon which is OSGi based. This will enable you to deploy different versions of the same jars if we need to, and so it will hopefully avoid these version problems.

                  Cheers,

                  --Kurt

                  • 6. Re: Can't send  JMS messages to gateway
                    Vinicius Carvalho Apprentice

                    No problem :) It's good when we get it working :)

                    So far, I'm enjoying the experience, we are having a good feedback (for
                    what we need at least) with jboss esb. We'll have the system under production by january 15th :)

                    You guys are doing a great job
                    Best regards