5 Replies Latest reply on Mar 27, 2009 12:47 PM by abhilashjohn

    EJB 3 Jboss 4.2 GA Issue

    abhilashjohn

      Hi
      Has any one faced this before?
      Any pointers on the solution?


      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.1.
      1.1:1099 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 connec
      t to server 127.1.1.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 127.
      1.1.1:1099
      [Root exception is java.net.ConnectException: Connection refused: connect]]]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at com.ejb.client.Client.main(Client.java:16)
      Caused by: javax.naming.CommunicationException: Failed to connect to server 127.1.1.1:1099 [Root exception is javax.nami
      ng.ServiceUnavailableException: Failed to connect to server 127.1.1.1:1099 [Root exception is java.net.ConnectException:
      Connection refused: connect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
      ... 4 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 127.1.1.1:1099 [Root exception is java.
      net.ConnectException: Connection refused: connect]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
      ... 5 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.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 org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
      ... 5 more

        • 1. Re: EJB 3 Jboss 4.2 GA Issue
          peterj

          127.1.1.1? Without any other information, my guess is that your hosts file is messed up.

          What OS? What version of JBoss AS? Did you start JBoss AS with the -b option?

          • 2. Re: EJB 3 Jboss 4.2 GA Issue
            abhilashjohn

            Hi
            THis is in jboss-4.2.2.GA. I tried both with and without -b options. The OS is Windos XP SP2.
            My JNDI.properties are as follows
            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            java.naming.provider.url=jnp://127.1.1.1:1099


            I tried different combination's of this, without success... Any clue please?

            • 3. Re: EJB 3 Jboss 4.2 GA Issue
              abhilashjohn

              Hi I found the solution thanks to another post of yours, Peter.... Thanks a lot for the clue. the issue was resolved at C:\WINDOWS\system32\drivers\etc\hosts

              • 4. Re: EJB 3 Jboss 4.2 GA Issue
                peterj

                For the benefit of others who might run into the same problem, could you post how the issue was solved in the hosts file?

                Why are you using 127.1.1.1 in the jndi properties instead of 127.0.0.1?

                • 5. Re: EJB 3 Jboss 4.2 GA Issue
                  abhilashjohn

                  three mistakes in my life:
                  1. the port in the server\default\conf\jboss-service.xml was 2099, not 1099
                  2. i had messed up with the etc\host file
                  3. i forgot about these changes, untill i saw your post and did the telnet