You work with EJBs inside another EJB the same way as you do inside a JSP

Remember you have to use the JNDI name, not the home interface name, so a
lookup("ejbSomeExample") will ofcourse return the home interface :)

Hope this helps (ps remember ejb-refs to the objects you wish to use from
the bean you are calling from or it will not work..

Klaus

-----Opprinnelig melding-----
Fra: Randahl Fink Isaksen [mailto:[EMAIL PROTECTED]]
Sendt: 18. januar 2001 11:00
Til: Orion-Interest
Emne: Getting the home interface of another EJB from within an EJB


>From inside an entity bean you can get hold of your Home interface by
calling

myBeansEntityContext.getEJBHome()

but how do I get hold of the home interface of _another_ bean?

I assume this requires some kind of lookup. In JSP files one would simply
use "new InitialContext()" and perform a lookup on this context, but if I do
so within an EJB, I am not able to find any home interfaces at all - I get a
NameNotFoundException.

Now, is it really necessary to go all the way and get an InitialContext by
setting up environment properties and creating an InitialContext from these
plus adding an "application-client.xml" to the deployment....?? - After all
I am still inside an EJB...


Any hints would be appreciated.

Randahl


Reply via email to