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!