1 Reply Latest reply on May 5, 2004 5:09 AM by efe

    Multiple jboss instances on multihomed machine

    efe

      Hi there,

      I'm quite puzzled by the following and hope someone will be able
      to help me.

      Server Configuration:
      Win2K
      Sun JDK 1.3.1_03-b03
      JBoss 3.2.2 (build: CVSTag=JBoss_3_2_2 date=200311131353)

      Client Configuration:
      Win2K or WinNT4
      Sun JDK 1.3.1_03-b03

      I try to set up a multi-homed app-server to run twin jboss servers
      on the same machine based on the default configuration. The application
      is an EJB application packaged in an EAR accessed from a swing client by RMI calls.

      To avoid change to deployment ant tasks, I decided to activate two IP address on the server, say "x.x.60.82" and "x.x.160.82", and have the DNS configured to match them with two distinct hostname, say "myname" and "myname2". I started the twin jboss server with the --host=myname (resp. myname2) parameters to bind the distinct hostname to each instance (@see org.jboss.system.server.ServerConfig.SERVER_BIND_ADDRESS).

      [Note that the smtp service of the second-launched server seems not to support the binding and fails to start, but I'm not using the service anyway]

      I copied my ear and datasource configuration in both deploy directories.
      I checked the two admin consoles (http://<server-hostname>:8080/jmx-console),
      and everything seems to have deployed correctly under the specified JNDI mapping, as say the server logs also.

      I the jboss.j2ee, I actually see for both instance:
      # jndiName=alisfin/facade/user,service=EJB

      I can connect from a client on the first hostname (myname/60.82), first means here in the order of IP declaration on the network adapter I guess (no clue yet).

      However, when I try to connect to the second server from another client, from same client-host or not, the lookup of EJBHome fails. Below is some useful trace (not to long):

      2003-12-16 10:30:44,140 DEBUG - .locator.JNDIFetcher: [Parametres d'initialisation de InitialContext [{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.provider.url=jnp://myname2:1099, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}]]

      2003-12-16 10:30:44,796 DEBUG - .locator.JNDIFetcher: [lookup: name=[alisfin/facade/user] class=[com.atos.jade.ejb.facade.interfaces.UserFacadeHome]]

      2003-12-16 10:30:46,281 FATAL - .locator.JNDIFetcher: []
      javax.naming.CommunicationException. Root exception is
      java.rmi.NoSuchObjectException: no such object in table
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at com.atos.jade.main.locator.JNDIFetcher.fetchObject(JNDIFetcher.java:43)
      at com.atos.winloan.clientdelegate.rmi.ClientServiceLocator.getEJBHome(ClientServiceLocator.java:182)
      ...


      Any suggestions greatly appreciated.

      Regards,
      Emmanuel

        • 1. Re: Multiple jboss instances on multihomed machine
          efe

          Sharing my solution since I found out some time ago already :)
          This amazing behavior was due to incorrect setting of my JVM environment.
          To solve this I wrap the starter script by the following, preventing edition of run.bat/sh itself.

          For Win32: run-{config}.bat
          setlocal
          set JAVA_OPTS=-Djava.rmi.server.hostname={myhost}
          call run.bat -c {myconfig} --host={myhost}
          endlocal

          For UNIX/csh:run-{config}.sh
          #! /bin/csh
          setenv JAVA_OPTS "-Djava.rmi.server.hostname={myhost}"
          run.sh -c {myconfig} --host={myhost}

          HTH