3 Replies Latest reply on Sep 21, 2007 4:46 PM by brian.stansberry

    HA-JNDI and HA-JMS problem

    igain

      Hi All,

      I have 2 jboss nodes configured in cluster which is for QA environment.

      When my application try to lookup the Queue destination on HA-JNDI port which is 1100 i get following exception on one node but at the same time it picks the Queue from other node

      2007-09-21 11:17:42,293 DEBUG [org.jnp.interfaces.NamingContext] Failed to connect to null:1100
      javax.naming.CommunicationException: Failed to connect to server null:1100 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server null:1100 [Root exception is java.net.UnknownHostException: null]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)



      Is this behaviour is correct or not ?

      And lookup code is like this

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,IConstants.INITIAL_CONTEXT_FACTORY);
      
      p.put(Context.URL_PKG_PREFIXES, IConstants.URL_PKG_PREFIXES);
      
      //Host is coming from jboss.bind.address property
      String host = System.getProperty(IConstants.SYSTEM_HOST_PROP);
      
      // HA-JNDI url.
      p.put(Context.PROVIDER_URL, host + ":" + IConstants.PROVIDER_URL_PORT);
      
      InitialContext ctx = new InitialContext(p);
      //looking for jms queue destination
      ctx.lookup(...)
      


      Another problem is i tried to put localhost instead of host variable, however in that case it was ont wokring on both the nodes so i did change it to jboss bind address to ensure it picks from the node hwre code is getting executed.

      Any help would be appreciated.

      Thanks

        • 1. Re: HA-JNDI and HA-JMS problem
          brian.stansberry

          Looks like System.getProperty(IConstants.SYSTEM_HOST_PROP) is returning null.

          • 2. Re: HA-JNDI and HA-JMS problem
            igain

            Yeah you are right that property is retrning null

            The value is Icontants.SYSTEM_HOST_PROP=jboss.bind.address

            So when i start jboss server with -b <ip-address> switch i will get the binding ip address of the server and using i am constructing provider_url for Context.


            And both jboss nodes i am starting with partition name as QA-Cluster
            and binding addrress as 192.168.1.101 and 102
            so command is

            run.sh -c all -b 192.168.1.101 -g QA-Cluster
            run.sh -c all -b 192.168.1.102 -g QA-Cluster

            Am i missing something here while starting ? or something else is problem

            • 3. Re: HA-JNDI and HA-JMS problem
              brian.stansberry

              If IConstants.SYSTEM_HOST_PROP="jboss.bind.address" and you're starting with -b, that should work. Sounds like you need to run it in a debugger or add some logging or something to see why 'host' is getting set to null.