2 Replies Latest reply on Dec 11, 2002 7:12 AM by stefe

    RMI lookup for cluster nodes

    stefe

      Hi!

      When I have two or three JBoss instances running on one machine, how can I
      make the InitialContext.lookup() find a distinguished one of them? The lookup
      example from the doku only uses the server name which is obviously the same
      for all instances.

      serverName = InetAddress.getLocalHost().getHostName();
      RMIAdaptor server = (RMIAdaptor) ic.lookup("jmx:" +serverName+ ":rmi");

      Is there a way to use the NamingService port (i.e. 1099 or the numbers configured
      for the other instances) for a selected lookup?


      Thanks a lot

      Stefan

        • 1. Re: RMI lookup for cluster nodes
          slaboure

          I guess you are mixing two things: JNDI lookup and using a JMX invoker.

          To lookup a specific JNDI tree, you can set the appropriate host:port setting in jndi.properties or use an explicit "new InitialContext (bla)" construct where bla contains your specific settings.

          cheers,


          sacha

          • 2. Re: RMI lookup for cluster nodes
            stefe


            Thanks a lot, now I can reach each instance with a port-specific InitialContext as I wanted. No, it did not take me a whole week to figure it out ;-), I have just been busy with other stuff and could only answer today.