Calling EJBs from other EJBs in other J2EE Server?

How can I call one EJB on one J2EE Server from otherEJB on other J2EE Server?Help me, please.Dmitry Tumanov
[149 byte] By [DTUMANOV] at [2007-9-26 4:24:44]
# 1

Basically call the beans as if you were calling them in the same server through their remote interfaces. Get a InitialContext into the other appserver and then get the home object, narrow it and create a remote reference. You can follow the standard implementation just make sure that the InitialContext you create has the right properties, ie. context factory, urls, etc to the OTHER appserver.

DatBean at 2007-6-29 17:32:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thanks, DatBean.

Excuse me for my terrible English.

Context remoteEnv = (Context)initial.lookup("iiopname://"+driveHost+":"+drivePort);

Object objref = remoteEnv.lookup("DriveServer");

This code works from client application, but not work from EJB:

java.lang.RuntimeException: Cannot propogate username/password required by target when using run as identity.

DTUMANOV at 2007-6-29 17:32:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...