0 Replies Latest reply: May 26, 2010 3:56 PM by yashendra chandrakar RSS

    Jboss 5, JNDI lookup failing with IPv6

    yashendra chandrakar Newbie

      Hi,

      I am using Jboss 5.0.1

      JNDI lookup is failing for me if I use IPv6, though it works fine for same set of servers for IPv4.

       

      I have this code to handle IPv4 and IPv6 URLs

      if (host instanceof Inet6Address) {
            env.setProperty(Context.PROVIDER_URL, "jnp://[" + host.getHostAddress() +  "]:1099/");
      } else {
           env.setProperty(Context.PROVIDER_URL,  "jnp://" + host.getHostAddress() + ":1099/");
      }

      This is the error I am getting

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: [2001:db8:aaaa:0:214:4fff:fe9f:4
      700]:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is ja
      va.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to con
      nect to server [2001:db8:aaaa:0:214:4fff:fe9f:4700]:1099:1099 [Root exception is javax.naming.ServiceUnavailableExcepti
      on: Failed to connect to server [2001:db8:aaaa:0:214:4fff:fe9f:4700]:1099:1099 [Root exception is java.net.UnknownHostE
      xception: [2001:db8:aaaa:0:214:4fff:fe9f:4700]:1099]]]
              at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)

       

      Doese this open ticket indicate that IPv6 is not supported in Jboss 5.0.1?

      https://jira.jboss.org/browse/JBPAPP-2941

      https://jira.jboss.org/browse/JBNAME-45

       

      I can also see this closed ticket

      https://jira.jboss.org/browse/JBAS-6390

      but again this ticket has following comment in it

      Could not we add support for standard URL notation containing IPV6  address? E.g.:

      jnp://[fec0::f101:21a:a0ff:fea0:d745]:1099

      Some test cases in the testsuite rely on HOST:PORT notation. Thanks.

       

      I wonder if I need to user URL

      jnp://ipv6address@port

      in place of

      jnp://[ipvgaddress]:port

       

      Thanks