4 Replies Latest reply on Oct 30, 2002 9:14 PM by Joel Vogt

    Running Client

    David B. Moffett Newbie


      I believe that I have the JBoss server running since is starts without any errors. I am running JBoss on Madrake linux using jdk 1.3.1 and jboss 3.0.3. I am having two problems getting the client to connect. Ok Ok I have more than two problems. :-)

      1. On the machine that jboss is running the client seems to want to connect to the local machine at address which is the NAT address of the machine through my firewall. The machine is know locally as or niko.

      [dmoffett@mail template]$ hostname

      I have tried to configure the machine to use but JNDI seems to always try to connect to Here is my jndi.properties file.

      [dmoffett@mail bin]$ cat jndi.properties

      This just shows that niko resolvs to

      [dmoffett@mail bin]$ ping niko
      PING mail ( from : 56(84) bytes of data.
      64 bytes from mail ( icmp_seq=0 ttl=255 time=51 usec
      64 bytes from mail ( icmp_seq=1 ttl=255 time=40 usec

      My question is how can I configure JNDI to look for niko instead of mail.dbinspector.net?

      Here is the stack trace for the error described above:

      javax.naming.CommunicationException. Root exception is java.rmi.ConnectException: Connection refused to host:; nested exception is:
      java.net.ConnectException: Connection timed out
      java.net.ConnectException: Connection timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:355)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:142)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:129)
      at java.net.Socket.(Socket.java:273)
      at java.net.Socket.(Socket.java:100)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
      at org.jnp.server.NamingServer_Stub.listBindings(Unknown Source)
      at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:674)
      at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:662)
      at javax.naming.InitialContext.listBindings(InitialContext.java:399)
      at test.client.TestClient.main(TestClient.java:22)

      2. I tried to make the client work from a remote box. The remote box is a OS X machine. The OS X machine seems to do better but I am getting the following error:

      javax.naming.CommunicationException: Receive timed out. Root exception is java.io.InterruptedIOException: Receive timed out
      at java.net.PlainDatagramSocketImpl.receive(Native Method)
      at java.net.DatagramSocket.receive(DatagramSocket.java:387)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:930)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1017)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:447)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
      at javax.naming.InitialContext.lookup(InitialContext.java:345)
      at test.client.TestClient.main(TestClient.java:21)

      My jndi.properties file:

      cat jndi.properties

      Any ideas ?

      Thank you for any help.


        • 1. Re: Running Client
          David B. Moffett Newbie

          Apparently JBoss is returning the name of the machine from the lookup. This name is mail.dbinspector.net and not niko. I would like the JBoss server to either use or niko. I have checked to configuration files in the conf directory and can't see where I would configure JBoss to force it to use the name on the LAN rather trying to go out through my firewall.

          As far as I can tell this issue is not addressed in the JBoss Administration and Development PDF Book.

          Thank you,

          • 2. Re: Running Client
            Joel Vogt Master

            I'm not very big with mandrake but your first problem can probably be solved by looking at your /etc/hosts file. Make sure the 192 address is there and mapped to your machine.

            As for the other problem, might be the same deal. Worth a look anyways

            • 3. Re: Running Client
              David B. Moffett Newbie

              Thank you for the suggestions. Here is my /etc/host file

              cat hosts
     localhost.localdomain localhost
     mail niko

              I think everything is in order. Through more investigation I have determined that the server is responding to the remote client with the following mashalled object. There are some no printable chars but I think you will get the gist. I would like to configure jboss to use the local IP addresses and not the NATed addresses. I am not much of a sys admin to any help would be great.

              This is a telnet session that shows the strings in a serialed object that is returned to the remote client. This shows a couple of things:
              1. My remote client can connect to jboss.
              2. jboss is telling my remote client about the address where I would like to use

              telnet niko 1099
              Connected to niko.
              Escape character is '^]'.
              ´´´´srjava.rmi.MarshalledObject|´´´´´´c´´>IhashlocBytest[BobjBytesq~xp´´´´´´*ur[B´´´´T´´xp2´´´´t!http://mail.dbinspector.net:8083/q~q~uq~,´´sr org.jnp.server.NamingServer_Stubxrjava.rmi.server.RemoteStub´´´´´´K´´exrjava.rmi.server.RemoteObject´´a´´´´
    ´´´´d´´M´´0®u´´xConnection closed by foreign host.

              Again Thank you if you can get me up and running. I am sure there is a simple configuration solution to this issue but I have yet to find it in the forums, FAQ or docs.

              BTW Mandrake is a derivitive of Redhat.


              • 4. Re: Running Client
                Joel Vogt Master

                have you tried setting the provider url in your jndi settings? Try this pointing to your 192 address and see what it tells you