Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4474

Connection Reset During JNDI lookup for Queues/Topics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.2.0.GA
    • Naming
    • None
    • Os is windows2003 server. JRE: 1.5

      When we try to do a look up for a Queue/Topic name, the lookup fails with error "Connection Reset".
      The stack trace:
      javax.naming.CommunicationException: Failed to retrieve stub from server <ServerName>: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)
      ....

      This does not happen every time when i do the look up. This error happens for few times during a load runs for long time.
      My client code
      InitialContext itc = new InitialContext(properties);
      QueueConnectionFactory factory = itc.loopkup("java:/XAConnectionFactory);
      Queue queue = itc.lookup("QueueName");

      Always the error happens at the second lookup( Queue look up). So as a workaround i tried to have a retry mechanisum, but with the same initialContext when i do the lookup again after failure, it fails futher with the same error. Is that InitialContext gets invalid?.

      Also i tried retry with new InitialContext, most of the time it worked but for some time the retry has failed with the same error. I dont know what is the cause for such a failure.

      Properties that are passed to the initalContext:
      property.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      property.put(Context.URL_PKG_PREFIXES,
      "jboss.naming:org.jnp.interfaces");
      property.put(Context.PROVIDER_URL, <ServerName> + ":" + 8002);

      Sanjeeth S

              starksm64 Scott Stark (Inactive)
              sanjeeth_jira sanjeeth s (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: