Greetings,
could anyone tell me if it's *POSSIBLE* in *TOMCAT 3.2.4* to define a
<resource> of a datasource in server.xml for DBCP, a <resource-ref> in
web.xml, and retrieve it on init() of a servlet using JNDI??
I'm trying to do it as I do with TOMCAT 4.1.x, but I'm getting this
exception related to JNDI:
"
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
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
...
"
I'm doing this:
Context initCtx = new InitialContext();
this.ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/ngincaredb");
but probably I should initialize the context like this (not necessary on
TOMCAT 4.1.x):
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "????????");
Context initCtx = new InitialContext(env);
But, I have no clue what should I put in "??????" for use in tomcat
3.2.4...
please, can anyone give me a hint or if it's possible or not?
Or should I have to initialize a DBCP on my code using some properties?
thanks,
Pedro Salazar.
--
<ps>
[EMAIL PROTECTED]
key id: 0E129E31D803BC61
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]