0 Replies Latest reply: Jan 18, 2012 1:52 AM by Shantanu Gontia RSS

    javax.naming.CommunicationException: Could not obtain connection to any of these urls

    Shantanu Gontia Newbie

      I am getting this error when i am trying to open a JNDi connection with Jboss. When i am clicking on the URL: https://localhost:9580 it is opening the jboss server but in program it is showing below error.

       

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: http://localhost:9580 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server http://localhost:9580:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server http://localhost:9580:1099 [Root exception is java.net.UnknownHostException: http://localhost:9580]]]

          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)

          at queue.QueueExample.example(QueueExample.java:25)

          at queue.QueueExample.main(QueueExample.java:99)

      Caused by: javax.naming.CommunicationException: Failed to connect to server http://localhost:9580:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server http://localhost:9580:1099 [Root exception is java.net.UnknownHostException: http://localhost:9580]]

          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)

          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)

          ... 5 more

      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server http://localhost:9580:1099 [Root exception is java.net.UnknownHostException: http://localhost:9580]

          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)

          ... 6 more

      Caused by: java.net.UnknownHostException: http://localhost:9580

          at java.net.InetAddress.getAllByName0(InetAddress.java:1157)

          at java.net.InetAddress.getAllByName(InetAddress.java:1083)

          at java.net.InetAddress.getAllByName(InetAddress.java:1019)

          at java.net.InetAddress.getByName(InetAddress.java:969)

          at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:81)

          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)

          ... 6 more

       

      Please help what can be done to solve this.