2 Replies Latest reply on Dec 8, 2004 11:41 AM by 843793

    RMI/IIOP reconnect to a failed server/orb

    843793
      We have the following problem:

      Our j2ee clients are Swing clients that connect to the J2EE SDK 8.0 Update 1 PE server using RMI over IIOP.

      When the server gows down and than up again, the client cant reconnect. For the reconnect we use the following staements:
      InitialContext ctx = new InitialContext();
      Object obj = ctx.lookup(facadeJndiName);
      befAsProdHome = (BefAsProdHome) PortableRemoteObject.narrow(obj, BefAsProdHome.class);
      It seems that the lookup failes because of a "bad server id" (see exception below).

      The background: First we want the stations to reconnect e.g. when server is restarted. The second thing is that we want to have a fail over server (same ejb module, same db, same ip - transparent to the clients) to which the stations should reconnect when the first one fails.

      So what are wrong? Restarting the whole statoin (=the JVM) does a clean connect to the server.
      18:14:22,069 ERROR [ PingRunner] BefCas - Could not connect station
      javax.naming.CommunicationException: serial context communication ex [Root exception is java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 1398079690 No; nested exception is:
           org.omg.CORBA.OBJECT_NOT_EXIST: ----------BEGIN server-side stack trace----------
      org.omg.CORBA.OBJECT_NOT_EXIST:   vmcid: SUN  minor code: 202  completed: No
           at com.sun.corba.ee.impl.logging.ORBUtilSystemException.badServerId(ORBUtilSystemException.java:7317)
           at com.sun.corba.ee.impl.logging.ORBUtilSystemException.badServerId(ORBUtilSystemException.java:7339)
           at com.sun.corba.ee.impl.orb.ORBImpl.handleBadServerId(ORBImpl.java:1396)
           at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.checkServerId(CorbaServerRequestDispatcherImpl.java:399)
           at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:167)
           at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
           at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
           at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
           at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
           at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
           at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
           at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
           at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
           at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
       
      ----------END server-side stack trace----------  vmcid: SUN  minor code: 202  completed: No]
           at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:142)
      I posted the same problem in the J2EE SDK forum but got no answer... I just cant be that its normal to restart all clients on serve failer!
        • 1. Re: RMI/IIOP reconnect to a failed server/orb
          843793
          I have exactly the same problem. The ejb i am trying to access is a stateless session bean. With entity beans it seems to go allright.

          Any news?
          • 2. Re: RMI/IIOP reconnect to a failed server/orb
            843793
            In another thread I saw the following solution:

            -> initialize the InitialContext with property Context.INITIAL_CONTEXT_FACTORY.
            context_props.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY );
            The value of this property set to com.sun.jndi.cosnaming.CNCtxFactory.

            This gives the following exception after a restart of the server:
            CORBA OBJECT_NOT_EXIST 1330446338 No; nested exception is: 
                 org.omg.CORBA.OBJECT_NOT_EXIST: ----------BEGIN server-side stack trace----------
            org.omg.CORBA.OBJECT_NOT_EXIST:   vmcid: OMG  minor code: 2  completed: No
                 at com.sun.corba.ee.impl.logging.OMGSystemException.noObjectAdaptor(OMGSystemException.java:3457)
                 at com.sun.corba.ee.impl.logging.OMGSystemException.noObjectAdaptor(OMGSystemException.java:3475)
                 at com.sun.corba.ee.impl.oa.poa.POAFactory.find(POAFactory.java:108)
                 at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.findObjectAdapter(CorbaServerRequestDispatcherImpl.java:427)
                 at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:185)
                 at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
                 at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
                 at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
                 at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
                 at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
                 at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
                 at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
                 at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
                 at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
            Caused by: org.omg.PortableServer.POAPackage.AdapterNonExistent: IDL:omg.org/PortableServer/POA/AdapterNonExistent:1.0
                 at com.sun.corba.ee.impl.oa.poa.POAImpl.find_POA(POAImpl.java:866)
                 at com.sun.corba.ee.impl.oa.poa.POAFactory.find(POAFactory.java:104)
                 ... 11 more