Greetings,
I'm downgrading my web application to work on tomcat 3.2.4 (initially
was developed and tested OK on tomcat 4.1.18). I'm using DBCP1.0.
problem:
--------
I can't get a datasource through JNDI that usually worked fine in tomcat
4.1.x, instead I'm getting an exception! Since I'm not aware about the
compatibility versions of tomcat, I ask for your help.
exception:
----------
"
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)
...
"
And is caused on the following server code:
"
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);
}
"
web.xml:
--------
<resource-ref>
<res-ref-name>jdbc/ngincaredb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
server.xml:
-----------
<Context path="/ngincare"
docBase="webapps/ngincare"
crossContext="true"
debug="9"
reloadable="true"
trusted="false" >
<Resource name="jdbc/ngincaredb" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/ngincaredb">
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
...
</ResourceParams>
</Context>
thanks,
Pedro Salazar
--
<ps>
[EMAIL PROTECTED]
key id: 0E129E31D803BC61
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]