You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Knight <pe...@eurostar.co.uk> on 2000/11/15 15:54:03 UTC

I have tried to invoke EJB's from TOMCAT: NoInitialContextException:

I have tried to invoke EJB's from TOMCAT and get:

Internal Servlet Error:
javax.servlet.ServletException: Need to specify class name in environment or
system property:
Root cause:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property: e.t.c.

The EJB resides in an Oracle 8i 8.1.6 database.
I have included the EJB API and the two EJB jar files in the class path and
it doesn't seem to matter what I do, I cannot get it to work!!
PLEASE PLEASE HELP ME!

Regards Peter Knight



_________________________________________________________________
Important Note: This E-Mail is confidential, it must not be read, 
copied, disclosed or used by any person other than the above 
named addressees. Unauthorised use, disclosure or copying is 
strictly prohibited and may be unlawful. Eurostar (U.K.) Limited 
disclaims any liability for any action taken in reliance on the 
content of this E-Mail. The comments or statements expressed in 
this E-Mail are not necessarily those of Eurostar (U.K.) Limited 
or its subsidiaries or affiliates.

Eurostar (U.K.) Ltd. Registered Office: Eurostar House, Waterloo
Station, London, SE1 8SE, Registered in England No. 2462001 
VAT No. GB 657 719 590
_________________________________________________________________

Re: I have tried to invoke EJB's from TOMCAT: NoInitialContextException:

Posted by Thom Park <tp...@inprise.com>.
Peter,

It looks like your JNDI context info isn't initialized (stating the obvious - I
apologize).

I had a similar problem (with env-entry constructs). Tomcat 3.2 doesn't come
with any JNDI so I had to add a JNDI service
layer of my own. Prior to the servlet that makes the EJB call, the JNDI
environment needs to be initialized such that any JNDI lookup calls
know where to start looking from.

Given I'm not an EJB wiz by any stretch of the imagination, all I can say is
check the EJB documentation from ORACLE that specifies the
setup steps needed to ensure that the intial context will succeed - I suspect
that the EJB call is trying to find EJB home or something or other from the
JNDI
service.

To solve my problem, I wrote a (very) simple interceptor that set up the initial
context information for the JNDI that I'm using in the preService call of the
interceptor. Sorry if I can't be of much more help.

I hope that you solve your problem. Tomcat 4.0 looks to be much, much nicer in
the JNDI area and for support of the ejb-ref construct (which Tomcat 3.x doesn't
deal with).

-Thom


Peter Knight wrote:

> I have tried to invoke EJB's from TOMCAT and get:
>
> Internal Servlet Error:
> javax.servlet.ServletException: Need to specify class name in environment or
> system property:
> Root cause:
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property: e.t.c.
>
> The EJB resides in an Oracle 8i 8.1.6 database.
> I have included the EJB API and the two EJB jar files in the class path and
> it doesn't seem to matter what I do, I cannot get it to work!!
> PLEASE PLEASE HELP ME!
>
> Regards Peter Knight
>
> _________________________________________________________________
> Important Note: This E-Mail is confidential, it must not be read,
> copied, disclosed or used by any person other than the above
> named addressees. Unauthorised use, disclosure or copying is
> strictly prohibited and may be unlawful. Eurostar (U.K.) Limited
> disclaims any liability for any action taken in reliance on the
> content of this E-Mail. The comments or statements expressed in
> this E-Mail are not necessarily those of Eurostar (U.K.) Limited
> or its subsidiaries or affiliates.
>
> Eurostar (U.K.) Ltd. Registered Office: Eurostar House, Waterloo
> Station, London, SE1 8SE, Registered in England No. 2462001
> VAT No. GB 657 719 590
> _________________________________________________________________