Well the first thing that strikes me is that there would be no (ejb) initial
context to obtain since Tomcat is not an EJB container. ;) 

I recommend downloading JBoss from http://www.jboss.org/ for doing that sort
of thing.  Their values for INITIAL_CONTEXT_FACTORY and PROVIDER_URL are on
their docs pages. :)

Chris

-----Original Message-----
From: Michael Schommer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 12:45 PM
To: [EMAIL PROTECTED]
Subject: NoInitialContextException


Hi,

I'm using a Tomcat 3.3 and try to access a session-EJB from an
Action-Class.
When I try to get an InitialContext in my Action-Class:

      Hashtable env = new Hashtable();
      Context ic =  new InitialContext(env);
      EJBMMHome home = (EJBMMHome) ic.lookup("EJBMM");

I get the error:

class javax.naming.NoInitialContextException:
Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial.

I think, the Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL, have
to put to the env-Hashtable.

env.put(Context.INITIAL_CONTEXT_FACTORY, initCtxFactory);
env.put(Context.PROVIDER_URL, providerURL);

??? but what are the values for initCtxFactory and providerURL ???

Can anybody help me?

Gruß
Michael

--
Java - write once, run anywhere


Reply via email to