3 Replies Latest reply on May 7, 2005 3:46 AM by deng

    java.rmi.connectException

    pavana

      hi,

      I am trying to connect to a remote system on which Jboss server is running. when i run the client program to connect to remote server i am gettting the following error

      Exception in thread "main" javax.naming.CommunicationException [Root
      exception is java.rmi.ConnectException: Connection refused to host:
      127.0.0.1; nested exception is:
      java.net.ConnectException: Connection refused]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:649)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at SendRecvClient.setupPTP(SendRecvClient.java:77)
      at SendRecvClient.main(SendRecvClient.java:113)
      Caused by: java.rmi.ConnectException: Connection refused to host:
      127.0.0.1; nested exception is:
      java.net.ConnectException: Connection refused
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
      at
      sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
      at
      sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
      ... 4 more
      Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at
      java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at java.net.Socket.(Socket.java:309)
      at java.net.Socket.(Socket.java:124)
      at
      sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
      at
      sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)

      I have given jboss server IP wherever required.......
      but still getting the error...


      some one please help me out...


      any kind of help is appreciated......


      Thank in advance


        • 1. Re: java.rmi.connectException
          darranl

          Is the remote server running Linux?

          Have you specified the IP address in /etc/hosts?

          • 2. Re: java.rmi.connectException
            kcochrane

            Hello,
            You could try specifying the property java.rmi.server.hostname to the jvm that is running the jboss server. This should be a name or ip the clients can to use to connect to the server. I think this defaults to localhost (127.0.0.1) normally.
            One way to do this would be to add it to the end of the JAVA_OPTS variable in the run.bat (or run.sh) script.

            set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -Djava.rmi.server.hostname="YourHostname"

            Not sure if perhaps there is a better way to do this?

            • 3. Re: java.rmi.connectException
              deng

              rty to Use ./run.sh -c default --host=server's Ip address

              ./run.sh --help will show you the help message