users@glassfish.java.net

EJB3 Remote Referece Thread Safe?

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 Jul 2008 05:33:59 PDT

Hello, I've developed a Swing Application that acts like a client to a EJB3 Session Bean.
In the MainFrame I store the remote reference that I get through InitialContext. Is it possible to use that refence in different threads to call stateless session bean methods?

I've done some tests, and it seem to work, but sometimes I'm getting a strange exception in the client, and I was wondering if it could be a thread safe issue. The exception is:

09-07 08:59:34,000 ERROR [Thread-52] - nested exception is: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079707 Maybe; nested exception is:
        org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 219 completed: Maybe
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079707 Maybe; nested exception is:
        org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 219 completed: Maybe
java.rmi.MarshalException: CORBA COMM_FAILURE 1398079707 Maybe; nested exception is:
        org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 219 completed: Maybe
        at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:271)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
        at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
        at com.inelcom.icor.adif.ejb.equipos.__EquiposFacadeRemote_Remote_DynamicStub.validaSesion(com/inelcom/icor/adif/ejb/equipos/__EquiposFacadeRemote_Remote_DynamicStub.java)
        at com.inelcom.icor.adif.ejb.equipos._EquiposFacadeRemote_Wrapper.validaSesion(com/inelcom/icor/adif/ejb/equipos/_EquiposFacadeRemote_Wrapper.java)
        at com.inelcom.icor.adif.po.explorador.ValidaSesionThread.run(ValidaSesionThread.java:57)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 219 completed: Maybe
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.communicationsTimeoutWaitingForResponse(ORBUtilSystemException.java:3180)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.communicationsTimeoutWaitingForResponse(ORBUtilSystemException.java:3195)
        at com.sun.corba.ee.impl.transport.CorbaResponseWaitingRoomImpl.waitForResponse(CorbaResponseWaitingRoomImpl.java:198)
        at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.waitForResponse(SocketOrChannelConnectionImpl.java:1196)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.waitForResponse(CorbaMessageMediatorImpl.java:291)
        at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(CorbaClientRequestDispatcherImpl.java:389)
        at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:357)
        at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:219)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:192)
        ... 5 more
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079707 Maybe; nested exception is:
        org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 219 completed: Maybe
        at com....ejb.equipos._EquiposFacadeRemote_Wrapper.validaSesion(com...ejb/equipos/_EquiposFacadeRemote_Wrapper.java)
        at com.....explorador.ValidaSesionThread.run(ValidaSesionThread.java:57)

I'm using Glassfish v2ur1.

Thanks for your time.
[Message sent by forum member 'abelmj' (abelmj)]

http://forums.java.net/jive/thread.jspa?messageID=285357