1 Reply Latest reply on Jun 7, 2003 10:32 PM by jonlee

    CommunicationException on JNDI lookup

    pyppo

      Hi all,

      I'm trying to develop my first EJB, it's a STATEFULL SESSION BEAN, when I run JBoss and the client on the same machine all goes well, but when I try to run the client on a machine and JBoss on another one I get this Exception on the javax.naming.InitialContext.lookup:

      javax.naming.CommunicationException. Root exception
      is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exce
      ption is:
      java.net.ConnectException: Connection refused: connect
      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:456)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at FirstClient.main(FirstClient.java:11)
      Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
      at java.net.Socket.connect(Socket.java:425)
      at java.net.Socket.connect(Socket.java:375)
      at java.net.Socket.(Socket.java:290)
      at java.net.Socket.(Socket.java:118)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
      SocketFactory.java:22)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
      SocketFactory.java:122)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
      ... 8 more


      It appears strange because the IP address of the server is 192.168.1.3 and I set the java.naming.provider.url to 192.168.1.3:1099 (System.setProperty("java.naming.provider.url","192.168.1.3:1099").


      Please help,
      thank you in advance