I guess you mean an <ejb-ref> - I tried it, but it does not work - makes
Orion unable to deploy (DTD does not allow an <ejb-ref> in this place).

Thanks anyway.
Randahl

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Luke Nelson
Sent: 18. januar 2001 21:46
To: Orion-Interest
Subject: RE: Getting the home interface of another EJB from within an
EJB


Have you tried putting an ejb-link reference in your ejb-jar.xml?  Just an
idea.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Randahl Fink
Isaksen
Sent: Thursday, January 18, 2001 10:24 AM
To: Orion-Interest
Subject: RE: Getting the home interface of another EJB from within an
EJB


Thanks, Klaus - but the strange thing is, I have tried carrying out the
exact same lookup from within my JSP and within my EJB - for instance:

UserHome userHome = null;
object = context.lookup("java:comp/env/ejb/UserHome");
userHome = (UserHome) PortableRemoteObject.narrow(object, UserHome.class);

It works in my JSPs but inside my EJBs it throws a NameNotFoundException.


Any ideas???

Randahl

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: 18. januar 2001 11:49
To: Orion-Interest
Subject: SV: Getting the home interface of another EJB from within an
EJB


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