1 Reply Latest reply on May 2, 2007 10:06 AM by Tobias Akeblom

    NamingException Dusring Lookup: Connection Reset

    sanjeeth s Newbie

      Hello All,
      When i try to do a lookup for a Queue/Topic it gives be the following Naming Error

      javax.naming.CommunicationException: Failed to retrieve stub from server D1FBMCS:8002 [Root exception is java.net.SocketException: Connection reset]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:263)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(Unknown Source)

      Caused by : java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(Unknown Source)
      at java.io.BufferedInputStream.fill(Unknown Source)
      at java.io.BufferedInputStream.read1(Unknown Source)
      at java.io.BufferedInputStream.read(Unknown Source)
      at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)
      at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
      at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
      at java.io.ObjectInputStream.(Unknown Source)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:250)

      The Main cause of this problem is because of the Connection getting reset. Also This problem does not happen frequently. When i run my application for some long period of time only then this problem is happening and also it happens only few times.

      AnyBody know about this problem and when and why this connection will get reset.

      Also can the problem be because of the local Port which was in the TIME_WAIT state was used for creation of sockets.

      I am using JBoss:JBoss 4.0.4 GA
      Os:Windows
      8002 is the port where NamingService is running and its RMI port is 8003

      Regards
      Sanjeeth S

        • 1. Re: NamingException Dusring Lookup: Connection Reset
          Tobias Akeblom Newbie

          I have a similar problem that needs to be solved..

          I have a test client with wich I try to send messages to a remote que. Sending to my local server works well, but when sending to the remote server, I get the following trace :

          Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.ConnectEx
          ception: Connection refused to host: 213.187.xxx.xxx; nested exception is:
          java.net.ConnectException: Connection timed out: connect]
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
          at javax.naming.InitialContext.lookup(Unknown Source)
          at JmsClientTest.main(JmsClientTest.java:25)
          Caused by: java.rmi.ConnectException: Connection refused to host: 213.187.196.148; nested exception
          is:
          java.net.ConnectException: Connection timed out: connect
          at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
          at sun.rmi.server.UnicastRef.invoke(Unknown Source)
          at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
          ... 3 more
          Caused by: java.net.ConnectException: Connection timed out: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(Unknown Source)
          at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
          at java.net.PlainSocketImpl.connect(Unknown Source)
          at java.net.SocksSocketImpl.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.(Unknown Source)
          at java.net.Socket.(Unknown Source)
          at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
          at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
          ... 9 more