Skip to Content
0
Former Member
Jan 13, 2007 at 12:48 AM

Canu00B4t call an EJB from other EJB

13 Views

Hi developers,

I need do the next task :

I have a EJB in an EAR and i need call some functionality from other EJB in diferent EAR , when execute the code show the next message error:

java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method generaMDMOutput.

at com.sapconsulting.customer.inc.CustomerIncObjectImpl0.generaMDMOutput(CustomerIncObjectImpl0.java:135)

at com.sapconsulting.customer.inc.CustomerIncObjectImpl0p4_Skel.dispatch(CustomerIncObjectImpl0p4_Skel.java:127)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java(Compiled Code))

at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java(Inlined Compiled Code))

at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java(Compiled Code))

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java(Compiled Code))

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java(Compiled Code))

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java(Compiled Code))

at java.security.AccessController.doPrivileged1(Native Method)

at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java(Compiled Code))

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java(Compiled Code))

Caused by: java.lang.ClassCastException: com.sap.engine.interfaces.cross.ObjectReferenceImpl

at com.sapconsulting.customer.inc.CustomerIncBean.generaMDMOutput(CustomerIncBean.java:141)

at com.sapconsulting.customer.inc.CustomerIncObjectImpl0.generaMDMOutput(CustomerIncObjectImpl0.java:119)

... 11 more

the code to invoke the EJB is the next:

ctx = new InitialContext();

TestEJBLocalHome home = (TestEJBLocalHome) ctx.lookup("sap.com/TestEJB_ear/TestEJBBean");

TestEJB servicio=(TestEJB)home.create();

the EJB are in the same server , please help,

regards