7 Replies Latest reply on Dec 24, 2006 6:40 AM by yair.zaslavsky

    jndi.properties jnp.timeout=60000000  ignored

    llucifer

      I'm setting the following settings in jndi.properties which is read by my client:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://localhost:1099
      java.naming.factory.url.pkgs=org.jboss.naming.client
      
      jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
      jnp.timeout=60000000
      jnp.sotimeout=60000000
      j2ee.clientName=test
      


      But it seems like the timeout settings are ignored, I catch the following exception:

      65746 ERROR org.jboss.remoting.transport.socket.SocketClientInvoker - Got marshalling exception, exiting
      java.net.SocketTimeoutException: Read timed out
       at java.net.SocketInputStream.socketRead0(Native Method)
       at java.net.SocketInputStream.read(SocketInputStream.java:129)
       at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
       at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
       at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2200)
       at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2490)
       at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2500)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1267)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:72)
       at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:244)
       at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:117)
       at org.jboss.remoting.Client.invoke(Client.java:201)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:34)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:79)
       at $Proxy0.findAll(Unknown Source)
       at ...
      


      Any ideas how the increase the client socket timeout?

        • 1. Re: jndi.properties jnp.timeout=60000000  ignored
          starksm64

          This is not a jndi issue. The call that is failing is an ejb3 call. See the remoting docs for configuring the invocation transport layer timeout.

          • 2. Solved: jndi.properties jnp.timeout=60000000  ignored
            llucifer

            After digging through the doc I found that changing an attribute in ejb3.deployer/META-INF/jboss-service.xml did the thing:

            <attribute name="InvokerLocator">socket://0.0.0.0:3873/?socketTimeout=300000</attribute>

            Thanks to scott for replying fast and helpfully.

            • 3. Re: jndi.properties jnp.timeout=60000000  ignored
              depl20982

              Hi,

              I'm using EJB3 with the JBOSS 4.03 RC2 on Windows 2003 server,

              I got a stateless bean and I am testing it with concurrency, but when the method that I am calling lasts more than 60 seconds, i always get the following error in the client, and the server processes all without error.

              java.lang.reflect.UndeclaredThrowableException
              at $Proxy0.doWorkitem(Unknown Source)
              at com.vision.bizagi.wfes.testClient.MainClass.testWFMan(MainClass.java:143)
              at com.vision.bizagi.wfes.testClient.MainClass.run(MainClass.java:86)
              at java.lang.Thread.run(Thread.java:595)
              Caused by: java.rmi.ConnectException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
              java.net.SocketTimeoutException: Read timed out
              at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:266)
              at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:117)
              at org.jboss.remoting.Client.invoke(Client.java:201)
              at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
              at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:60)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
              at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
              at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
              at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:41)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
              at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:85)
              ... 4 more
              Caused by: java.net.SocketTimeoutException: Read timed out
              at java.net.SocketInputStream.socketRead0(Native Method)
              at java.net.SocketInputStream.read(SocketInputStream.java:129)
              at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
              at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
              at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2200)
              at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2490)
              at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2500)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1267)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
              at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:72)
              at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:244)
              ... 17 more


              Then I put a Thread.sleep(60000) in the method that I am calling, and with a single client I always get the error.

              I've tried to modify the jndi properties for the client using a TimedSocketFactory and setting a long timeout and no timeout and still no working, after that I've found this post and tried to modify the socketTimeout from the server in the ejb3.deployer/META-INF/jboss-service.xml, and no matter how many milliseconds I set in the attribute, I always get the same error.

              Any ideas how to solve this?

              Thanks in advance

              Diego


              • 4. Re: jndi.properties jnp.timeout=60000000  ignored
                kidjava

                Does anyone know how to solve the above problem, I have a bean method that takes a little bit more than 60 secs and I get the timeout, is there a way to set it higher?

                • 5. Re: jndi.properties jnp.timeout=60000000  ignored
                  kidjava

                  sorry, the fix by llucifer works updating the jboss-service.xml file
                  socket://0.0.0.0:3873/?socketTimeout=300000

                  • 6. Re: jndi.properties jnp.timeout=60000000  ignored
                    yair.zaslavsky

                    I did the same in my jboss-service.xml file (I'm using jboss 4.0.5GA ) over Linux.
                    At first - I tested with a value of 1 second, and it did work (got timeout after 1 second).
                    Then, I changed the value to 7200 seconds (2 hours) but I got the SocketTimeout exception with a value of 1800 seconds.

                    Can anyone tell me what is wrong?

                    • 7. Re: jndi.properties jnp.timeout=60000000  ignored
                      yair.zaslavsky

                      Hi all, first of all, turns out that my experiment with 1000 miliseconds did not work (the exception I got came due to another reason).

                      I looked inside the code of JBoss-Remoting 1.4.4 and found out that in SocketClientInvoker.java

                      the constant SO_TIMEOUT_FLAG is now defined as:

                      public static final String SO_TIMEOUT_FLAG = "timeout";


                      so the parameter that should be used as written in previous posts at this thread is not "socketTimeout" but "timeout" (in JBOSS 4.0.5)
                      I tested this on windows XP with setting the value to 5 seconds and it worked.