1 Reply Latest reply on Nov 13, 2006 2:22 AM by mp123

    JMS Queue Error on Petstore demo run under Cluster mode

    mp123

      Hello All,

      I would like to run the Petstore Demo Application on JBoss 4.0.4GA in 'all' mode of Cluster Configuration with two machines.

      I got the error while confirmOrder button clicked on webconsole, as follows.

      
      10:19:04,195 INFO [STDOUT] sendToJMSQueue(java:comp/env/jms/queue/xpetstore/order,1,false)
      10:19:04,270 ERROR [LogInterceptor] EJBException in method: public abstract java.lang.Integer xpetst
      ore.services.petstore.interfaces.PetstoreLocal.createOrder(java.lang.String,java.util.Date,java.util
      .Map) throws xpetstore.services.petstore.exceptions.CartEmptyOrderException,javax.ejb.FinderExceptio
      n,javax.ejb.CreateException, causedBy:
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFo
      undException: queue not bound]
       at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1067)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:700)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at xpetstore.util.JMSUtil.sendToJMSQueue(Unknown Source)
       at xpetstore.services.petstore.ejb.PetstoreEJB.createOrder(Unknown Source)
       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.invocation.Invocation.performCall(Invocation.java:359)
      ..
      ..
      ..
      
      


      Please tell me, what all the other changes need to do with JMS in Petstore application for running it in Cluster mode.

      I need to do HA-JMS with that demo.

      Thanks in Advance,

        • 1. Re: JMS Queue Error on Petstore demo run under Cluster mode
          mp123

          Hello,

          Actually, I have run the two servers named node1 and node2 with Apache modjk load balancer by keeping node1 as the main node and it only bound the queue/order and queue/mail.

          I have did the below modification in both the server machines node1 as well as node2.

          I have copied the jndi.properties file from <JBOSS_HOME>/server/node1/conf/ path and copied to <JBOSS_HOME>/server/node1/lib/ path and with the following modifications.

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          
          java.naming.provider.url=<node1-ipaddress>:1100, <node2-ip address.:1100



          And, the lookup of queue is taken place in the application as follows.

          In the file,
          "<PETSTORE_HOME>/xpetstore-ejb/java/xpetstore/util/JMSUtil.java"

          ic = new InitialContext( );
           Queue queue = ( Queue ) ic.lookup( queueName );
           QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_C
          ONNECTION_FACTORY );
           cnn = factory.createQueueConnection( );



          While running the application,
          all the transaction is done by node1 till clicking the Submit button for sending mail to user. When I hit the submit button, the transaction goes to the second node node2 in which the queue is not bound.

          1. While two server is running, the sending of mail is not done and error comes as shown my post above.
          2. If any of one node is down, its automatically bound the queue and running the petstore application successfully.

          My problem is, the application should run successfully when all the nodes in the cluster are active.

          Please help me.