7 Replies Latest reply on Nov 28, 2012 8:27 AM by tiagoaugusto

    java.net.SocketTimeoutException: Read timed out

    csplrj1

      I have successfully deployed the bean on the JBoss Server
      I am able to get InitialContext Object but When the server comes at ic.lookup() statement it waits for some seconds and afterwards the following Exception is thrown as shown by toString() Function

      javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment;nested exception is: java.net.SocketTimeoutException: Read timed out]

      Urgent Help needed as I am stuck up at this problem for the last two days

        • 1. Re: java.net.SocketTimeoutException: Read timed out

          Your jndi properties are wrong.
          This has been posted a thousand times. Is search broken again?
          Also post full stacktraces.

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

          java.naming.factory.url.pkgs=org.jnp.interfaces

          java.naming.provider.url=localhost

          Regards,
          Adrian

          • 2. Re: java.net.SocketTimeoutException: Read timed out
            csplrj1

            I tried out but then also the same error

            The whole stack trace is as follows

            javax.naming.CommunicationException. Root exception is java.rmi.ConnectIOExcept
            ion: error during JRMP connection establishment; nested exception is:
            java.net.SocketTimeoutException: Read timed out
            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274

            at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
            at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at GreetingClient.Greeting1.(Greeting.java:42)
            at GreetingClient.Greeting1.main(Greeting.java:83)
            Caused by: java.net.SocketTimeoutException: Read timed out
            at java.net.SocketInputStream.socketRead0(Native Method)
            at java.net.SocketInputStream.read(SocketInputStream.java:116)
            at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
            at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
            at java.io.DataInputStream.readByte(DataInputStream.java:276)
            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215

            ... 8 more


            Thanks for the reply and Thanks in advance for your future reply

            • 3. Re: java.net.SocketTimeoutException: Read timed out
              csplrj1

              I had not included jnet.jar and jnp-client.jar Files in ClassPath

              After including these files following is the error
              Can you tell me what all files are to included for Client Application to access JBoss Server

              Following is the error


              javax.naming.CommunicationException: Receive timed out. Root exception is java.
              net.SocketTimeoutException: Receive timed out
              at java.net.PlainDatagramSocketImpl.receive(Native Method)
              at java.net.DatagramSocket.receive(DatagramSocket.java:670)
              at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:10
              93)
              at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1192)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
              at javax.naming.InitialContext.lookup(InitialContext.java:347)
              at GreetingClient.Greeting1.(Greeting.java:42)
              at GreetingClient.Greeting1.main(Greeting.java:83)


              Again Thanks in advance

              • 4. Re: java.net.SocketTimeoutException: Read timed out
                boxhead

                HAVE YOU FOUND A SOLUTION TO THIS PROBLEM? I BELIEVE THERE IS A BUG IN JBOSS.

                • 5. Re: java.net.SocketTimeoutException: Read timed out
                  thuryn

                  have somebody a solution? I've the same problem on 4.0.5 and I cannot find where is the problem.

                  • 6. Re: java.net.SocketTimeoutException: Read timed out
                    eminil

                    We get the same error, however it appears AFTER the application has been running for awhile. First it works alright.

                    The problem occurs in Tomcat when trying to lookup an EJB running in JBoss.

                    • 7. Re: java.net.SocketTimeoutException: Read timed out
                      tiagoaugusto

                      Hello guys, i saw that this thread is old, but i got the same error.

                       

                      When is a single user, no problems appear, but when i put jmeter to run, with about 50 iteration, the error show up. Have you solved the problem? I am using Jboss5.

                       

                      The got the error from the bold line.

                       

                      public static  T getEjbAsRemote(String jndi, Class clazz)                throws NamingException {
                      Context jndiContext = getInitialContext(); 
                      Object ref = jndiContext.lookup(jndi);
                      T t = (T) PortableRemoteObject.narrow(ref, clazz);           return t;
                      }