Hi,

I have a problem in using "java:comp/env".

I have an EJB, by name XYZ.  I added this to my applications' EJB module
and created a EJBReference in my web module.   When I tried to lookup
for this EJB using the following code, directly from servlet, it is
working fine.  But when I write the code in a simple java class and
access it from the servlet, it is not able to find the EJB,

Code:

InitialContext icxTemp = new InitialContext();
Object objHome =
PortableRemoteObject.narrow(icxTemp.lookup("java:comp/env/ejb/XYZ"),
XYZHome.class);

But when I replace "java:comp/env/ejb/XYZ" with "ejb/XYZ", which is the
actual JNDI name of the XYZ EJB, it is working fine in both the cases.

What could be the reason?  Do I need to pass any parameters to
InitialContext constructor?  If yes, why?  Any ideas?

thanks in advance,

Venkat.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to