It appears that it needs more than an empty constructor in
InitialContext():
try{
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...
thanks,
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.
>
--
<ps>
[EMAIL PROTECTED]
key id: 0E129E31D803BC61
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]