1 Reply Latest reply on Sep 7, 2004 5:54 AM by Panindrakumar Balellugari

    javax.naming.CommunicationException: Failed to connect to se

    rahuljainbit Newbie

      GOING thru the steps of site :-
      http://www.tusc.com.au/tutorial/html/chap1.html
      At the end while i was running the client code i got the following error.Could someone please help me:-
      Please reply the solution on mail id :- rahuljain81@gmail.com
      Thanks
      Error:-

      02:58:09,787 WARN [NamingContext] Failed to connect to 127.0.0.1:1099
      javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:213)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1185)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at test.Client.getHome(Client.java:26)
      at test.Client.testBean(Client.java:47)
      at test.Client.main(Client.java:67)
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)
      ... 7 more
      Caused by: java.net.ConnectException: Connection refused: 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.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:183)
      ... 7 more
      javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:1099
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1198)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at test.Client.getHome(Client.java:26)
      at test.Client.testBean(Client.java:47)
      at test.Client.main(Client.java:67)

        • 1. Re: javax.naming.CommunicationException: Failed to connect t
          Panindrakumar Balellugari Newbie

          Hi,

          [NamingService] Started jnpPort=1099, rmiPort=2098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076

          above line will be displayed first before the warning shown below. check if the "jnpPort" is same in both the messages if not change the jnpPort in jboss***\server\default\conf\jboss-service.xml file to 1099.

          14:58:52,902 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:1099

          Hope this helps.

          - Pani