how to do ejb calling another ejb

What do I have to do to program an ejb1 that calls another ejb2? Where do I place the client-jar files for ejb2 so that it is available for ejb1 on weblogic server (6.1)? Thanks.
[199 byte] By [jamesyin] at [2007-9-26 8:04:46]
# 1
in my projects we always stick 'em in the same big archive.
ingrilli at 2007-7-1 18:25:55 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

If your EJB's are running in the same application server, you should not have any problem. From the first EJB, call the second with:

Context initial = new InitialContext();

Object objref = initial.lookup("otherEJB");

...

, and when creating the first EJB you have to specify that this EJB call the other EJB in the field "EJB References" (enter the Coded name, JNDI name, home and remote interfaces).

Hope this helps.

urotsuki at 2007-7-1 18:25:55 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Also, not to mention that u have to put ur jar files(All ejb jar files) in weblogicInstallDir/config/mydomain/applications directory. If ur ejb's are in same server, then keep both the jar files in this directory and u can call "otherEJB" from oneEJB as

(Taken from other help)

Context initial = new InitialContext();

Object objref = initial.lookup("otherEJB");

...

, and when creating the first EJB you have to specify that this EJB call the other EJB in the field "EJB References" (enter the Coded name, JNDI name,

home and remote interfaces).

Remember, u have to keep ur home and remote class files under /weblogicInstallDir/config/Mydomain/ClientClasses dir. U can manually create "ClientClasses" or "ServerClasses" directory under /mydomain directory and place ur classfiles with proper package structure. Mention this "ClientClasses or ServerClasses(what ever u are using) in the classpath.

Hope this helps.

Elangovan

elangovan.k at 2007-7-1 18:25:55 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...