1 Reply Latest reply on Apr 26, 2008 2:10 AM by ron_sigal

    NoSuchObjectException on Server Restart

    jcreynol

      We're using a Swing application to connect to JBoss EAP 4.2CR1. The connecor is configured to use the UnifiedInvoker and a transport of rmi. This is a conversion from Weblogic 8.1. Everything works pretty nicely, but there are issues with a server restart where we are unable to reconnect to the new server, as it appears the RMIClientInvoker isn't refreshing to find the new server. Best I can tell, this is similar to this issue, here:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116027

      Is this a bug? Can anybody point to a workaround?

      The stacktrace in the client is, as follows:
      Caused by: java.rmi.NoSuchObjectException: no such object in table
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
      at org.jboss.remoting.transport.rmi.RMIServerInvoker_Stub.transport(Unknown Source)
      at org.jboss.remoting.transport.rmi.RMIClientInvoker.transport(RMIClientInvoker.java:238)
      ... 14 more

      Thanks,
      John

        • 1. Re: NoSuchObjectException on Server Restart
          ron_sigal

          Hi John,

          You're right that RMIClientInvoker doesn't try to reload the server stub in the event of an invocation error. More generally, Remoting clients don't promise to seek out a new server if an old one dies, although the socket transport is more likely to find a new server since it will attempt to create new connections when old ones become unusable.

          So, one strategy would be to try the socket transport, which is the usual choice anyway.

          Otherwise, a higher layer would need to recreate the Remoting client. Whether that's possible depends, of course, on what is running on top of Remoting and what kind of access you have. The usual structure in JBoss software, e.g., JBossMessaging and EJB3 clients, is to create a stack of interceptors, to which you can add your own. See, for example, org.jboss.aspects.remoting.InvokeRemoteInterceptor.