tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ps <>
Subject Re: DBCP+TOMCAT 3.2.4 -> javax.naming.NoInitialContextException
Date Wed, 05 Feb 2003 12:53:01 GMT
It appears that it needs more than an empty constructor in

   Context initCtx = new InitialContext();
   Context envCtx = (Context)initCtx.lookup("java:comp/env/");
   this.ds = (DataSource)envCtx.lookup("/jdbc/ngincaredb");
catch(NamingException e){
   logger.fatal("datasource error", e);

So, the solution maybe doing something like this:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "????????");
Context initCtx = new InitialContext(env);

But the obvious question (and unknown for me) is what should be the
tomcat 3.2.4 default JNDI factory to put in
Context.INITIAL_CONTEXT_FACTORY attribute?? And why in tomcat 4.1.x it's
enough put a empty InitialContext()?? 

I don't find docs for tomcat 3.2.x about the resources/jndi...

Pedro Salazar.

On Wed, 2003-02-05 at 11:48, ps wrote:
> Please, how should I interpret the exception message header below:
> 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'm using jdk1.4.1 (SUN) and tomcat 3.2.4.
> thanks,
> Pedro Salazar.

key id: 0E129E31D803BC61

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message