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

    Running Client

    dmoffett

      Hello,

      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 67.40.137.193 which is the NAT address of the machine through my firewall. The machine is know locally as 192.168.4.5 or niko.

      [dmoffett@mail template]$ hostname
      mail.dbinspector.net

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

      [dmoffett@mail bin]$ cat jndi.properties
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=niko

      This just shows that niko resolvs to 192.168.4.5

      [dmoffett@mail bin]$ ping niko
      PING mail (192.168.4.5) from 192.168.4.5 : 56(84) bytes of data.
      64 bytes from mail (192.168.4.5): icmp_seq=0 ttl=255 time=51 usec
      64 bytes from mail (192.168.4.5): 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: 67.40.137.193; 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
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=niko

      Any ideas ?

      Thank you for any help.

      David

        • 1. Re: Running Client
          dmoffett

          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 192.168.4.1 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,
          David

          • 2. Re: Running Client
            joelvogt

            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
              dmoffett

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

              cat hosts
              127.0.0.1 localhost.localdomain localhost
              192.168.4.5 mail niko
              192.168.4.3 centurian
              192.168.4.2 tele

              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 67.40.137.193 address where I would like to use 192.168.4.1.

              telnet niko 1099
              Trying 192.168.4.5...
              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´´´´
                                          a3xpw8
              67.40.137.193´´´´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.

              David

              • 4. Re: Running Client
                joelvogt

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