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.
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.