Results 1 to 4 of 4

Thread: RMI remoting Timeout for host disappeared

  1. #1
    Join Date
    Feb 2009
    Posts
    5

    Default RMI remoting Timeout for host disappeared

    Hi

    I am using RmiServiceExporter for RMI remoting on an application that needs to fail over.

    When I pull the network cable out of the remote computer to test the failover, the call takes about a minute to fail with RemoteLookupFailureException (cause java.net.ConnectException: Connection timed out: connect)

    Does anyone know a way to make it fail quicker than that?


    The stack trace while it is waiting for the timeout is:
    at java.net.SocketInputStream.socketRead0 ( Unknown source )
    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.DataInputStream.readByte ( DataInputStream.java:241 )
    at sun.rmi.transport.StreamRemoteCall.executeCall ( StreamRemoteCall.java:189 )
    at sun.rmi.server.UnicastRef.invoke ( UnicastRef.java:126 )
    at org.springframework.remoting.rmi.RmiInvocationWrap per_Stub.invoke ( Unknown source )
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke ( RmiClientInterceptor.java:393 )
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke ( RmiClientInterceptor.java:339 )
    at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke ( RmiClientInterceptor.java:258 )
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed ( ReflectiveMethodInvocation.java:171 )
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke ( JdkDynamicAopProxy.java:204 )
    at $Proxy63.getConfigurationDeltaUpdates ( Unknown source )


    After the one minute timeout, I get:
    org.springframework.remoting.RemoteLookupFailureEx ception: Lookup of RMI stub failed; nested exception is java.rmi.ConnectException: Connection refused to host: 192.168.110.207; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    Caused by:
    java.rmi.ConnectException: Connection refused to host: 192.168.110.207; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEnd point.java:574)
    at sun.rmi.transport.tcp.TCPChannel.createConnection( TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCP Channel.java:171)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java: 306)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.lookupStub(RmiClientInterceptor.java:199)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.refreshAndRetry(RmiClientInterceptor.java:320)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.handleRemoteConnectFailure(RmiClientIntercepto r.java:301)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:261)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy66.releaseAllForThread(Unknown Source)


    I notice that it is possible for a timeout to be set on the socket classes but I can't work out how to influence that from my Spring config or anywhere else.

    I thought about using this: http://forum.springframework.org/showthread.php?t=20127

    ...except that I only want a quick timeout in the cases where the host is unreachable. At other times, remote calls may legitimately take several minutes.

    Any help would be much appreciated. Thanks

    Paul.

  2. #2
    Join Date
    Aug 2004
    Posts
    13

    Default Progress?

    Any progress on this?

  3. #3
    Join Date
    Feb 2009
    Posts
    5

    Default Nope

    No despite looking in quite a lot of places I never got any further and didn't find a solution to influence the timeouts for some beans but not others

  4. #4
    Join Date
    Aug 2004
    Posts
    13

    Default no luck here either...

    Quote Originally Posted by paulhilliar View Post
    No despite looking in quite a lot of places I never got any further and didn't find a solution to influence the timeouts for some beans but not others
    This is frustrating.

    I have tried:
    System.setProperty("sun.rmi.transport.tcp.response Timeout", ...
    System.setProperty("sun.rmi.transport.tcp.handshak eTimeout", ...
    System.setProperty("sun.rmi.transport.tcp.readTime out", ...
    System.setProperty("sun.rmi.transport.connectionTi meout", ...

    Nothing help...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •