3 Replies Latest reply on Jul 25, 2008 9:32 AM by adrian.brock

    Cluster nodes fails to correctly deploy JMS Topic

    zdev

      We are currently using JBoss 4.0.5.GA_CP06. In one of our customer deployments, there is a two node cluster. We are seeing one of the nodes come up with no problem, but the other node comes up and fails to correctly deploy our JMS topic. The error in the stdout log is:


      20:30:17,718 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.mq.destination:service=Topic,name=Singlecast
      State: CONFIGURED
      I Depend On:
      jboss.mq:service=DestinationManager

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.mq:service=DestinationManager
      State: NOTYETINSTALLED
      Depends On Me:
      jboss.mq.destination:service=Topic,name=Singlecast


      I did some research on this, and I found something that said this would happen when using HAJMS and the topic was deployed in the server/[cluster]/deploy directory. It said to deploy the topic in the server/[cluster]/deploy-hasingleton directory instead. So I moved the destination service file accordingly. Here is that file:

      <!-- singlecast-destination-service.xml --> <?xml version="1.0" encoding="UTF-8"?>

      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager




      We now no longer get the error above, but we still see one of the nodes come up just fine, and the other node fail. Only now it fails within our own code. Specifically, it fails because "ConnectionFactory not bound". I am assuming I have not specified the JNDI name correctly, but I don't know what it is supposed to be. Here is how it configured right now:


      <!-- from web.xml -->
      <resource-ref>
      Singlecast Topic
      <res-ref-name>jms/SinglecastTopic</res-ref-name>
      <res-type>javax.jms.Topic</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      <resource-ref>
      Singlecast Topic Connection Factory
      <res-ref-name>jms/SinglecastTopicConnectionFactory</res-ref-name>
      <res-type>javax.jms.TopicConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>


      <!-- from jboss-web.xml -->
      <resource-ref>
      <res-ref-name>jms/SinglecastTopic</res-ref-name>
      <jndi-name>topic/Singlecast</jndi-name>
      </resource-ref>
      <resource-ref>
      <res-ref-name>jms/SinglecastTopicConnectionFactory</res-ref-name>
      <jndi-name>ConnectionFactory</jndi-name>
      </resource-ref>


      // from Java code
      InitialContext ctx = new InitialContext();
      TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
      _conConnection = factory.createTopicConnection("guest", "guest");
      _tpcTopic = (Topic) ctx.lookup("topic/Singlecast");
      _sesSession = _conConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicSubscriber sub = _sesSession.createSubscriber(_tpcTopic);
      sub.setMessageListener(this);
      _conConnection.start();

      Is there something wrong with what we are doing? Why would one of the nodes come up successfully but the other one not be able to find the JNDI name? Anything you could do to point us in the right direction would be very helpful.

        • 1. Re: Cluster nodes fails to correctly deploy JMS Topic

          Use hajndi-jms-ds.xml (the default config bound at java:/JmsXA) to access jms
          in a cluster.

          • 2. Re: Cluster nodes fails to correctly deploy JMS Topic

            What is the right location and contents of hajndi-jms-ds.xml file? According to the link -
            http://wiki.jboss.org/wiki/JBossMQHAOverview

            It should be under deploy-hasingleton but that doesn't seem to be its right place because I get deployment errors for DefaultJMSProvider. I have that file and the jms-ra.rar file under 'deploy' folder and all other JMS related files and my queue service file under deploy-hasingleton.

            We are using JBoss 4.0.5GA and 2 servers running in cluster pointing to same 'deploy' folder. Our master node comes up just fine but the slave node throws following exception -

            00000 ERROR 2008-06-27 13:52:16,438 org.jboss.ejb.plugins.jms.JMSContainerInvoker -- Reconnect failed: JMS provider failure detected for ALFServiceFlow
            javax.naming.NameNotFoundException: ALFServiceFlowRemoteQueueProvider not bound
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
             at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
             at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
             at javax.naming.InitialContext.lookup(InitialContext.java:351)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.getJMSProviderAdapter(JMSContainerInvoker.java:1051)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:502)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl$ExceptionListenerRunnable.run(JMSContainerInvoker.java:1428)
             at java.lang.Thread.run(Thread.java:595)


            We have configured ejb-jar.xml and jboss.xml [pointing to localhost:1100 for HA-JNDI] for our MDB as per the link above. We have also installed the example sar file that is distributed on the wiki to verify HA-JMS on clustered nodes and it is working as expected so what else could be wrong?

            Thank you,
            Meghana

            • 3. Re: Cluster nodes fails to correctly deploy JMS Topic

              No, you want all servers to access via HAJNDI so it should be on all
              servers, not the singleton master.

              Put it in deploy/jms

              It is the default config in deploy/jms/jms-ds.xml in the all configuration anyway.