users@glassfish.java.net

Problem accessing a remote EJB from EJB tier of the other Application

From: <glassfish_at_javadesktop.org>
Date: Mon, 08 Dec 2008 20:59:44 PST

We have two EJB 3.0 applications running in two different glassfish application servers. One application need to access a Stateless Remote EJB deployed into the other application.

When we access the Remote EJB from the web tier of the other application it works fine. The way we access it;

1. Included the Remote EJB jar file into the classpath.
2. Put the ejb-ref entry into the sun-web.xml;
<ejb-ref>
 <ejb-ref-name>AuthorizationServiceRef</ejb-ref-name>
 <jndi-name>corbaname:iiop:<host>:<port>#ejb/AuthorizationService</jndi-name>
</ejb-ref>
3. Use the @EJB annotation in the JSF back bean;
@EJB(name=” AuthorizationServiceRef”)
4. Invoke the methods on the remote object in the same back bean.

But when we try to access the same remote EJB from EJB tier of the other application we face an issue. The way we access it;

1. Included the Remote EJB jar file into the classpath.
2. Add the @EJB(mappedName=” corbaname:iiop: :<host>:<port> #ejb/AuthorizationService”) in a stateless session bean.
3. Invoke the methods on the remote object in the same stateless session bean.

We do see that the remote object is loaded (injected) into the client, but when a method is invoked into the remote object the client application is hanged and after some time we get the below timeout error;

[#|2008-12-05T11:19:52.384+0800|WARNING|sun-appserver9.1|javax.enterprise.resource.corba.ee.S1AS-ORB.rpc.transport|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-1;1800000;_RequestID=f188487e-0b0b-447f-9919-254604f83316;|"IOP00410219: (COMM_FAILURE) Communications timeout waiting for response. Exceeded 1,800,000 milliseconds"
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)
        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.juliusbaer.iafs.remote.__IAuthorizationService_Remote_DynamicStub.findRoles(com/juliusbaer/iafs/remote/__IAuthorizationService_Remote_DynamicStub.java)
        at com.juliusbaer.iafs.remote._IAuthorizationService_Wrapper.findRoles(com/juliusbaer/iafs/remote/_IAuthorizationService_Wrapper.java)
        at com.juliusbaer.amls.session.ManagerService.findUserRoles(ManagerService.java:167)

Note:
1. We tried with lookup the InitialContext.
2. We tried with deploying both application in one box(One glassfish server) but different domain.

In both cases we get the same issue.

Appreciate if any one can help us to resolve this issue.
[Message sent by forum member 'nilootpal' (nilootpal)]

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