tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ps <pedro-b-sala...@ptinovacao.pt>
Subject RE: DBCP+TOMCAT 3.2.4 (->4.1.x WORKED OK)
Date Wed, 05 Feb 2003 10:57:43 GMT
Its also there! I just downgraded from tomcat 4.1.x but I brought all
the dependent files.

See the exception error that has a strange message and probably has
something to do with JNDI...

thanks,
Pedro Salazar

On Tue, 2003-02-04 at 21:40, Zabel, Ian wrote:
> Whoops, and commons-pool.jar?
> 
> -----Original Message-----
> From: ps [mailto:pedro-b-salazar@ptinovacao.pt] 
> Sent: Tuesday, February 04, 2003 4:35 PM
> To: Tomcat Users List
> Subject: DBCP+TOMCAT 3.2.4 (->4.1.x WORKED OK)
> 
> 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:2
> 80)
>         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> 
> pedro-b-salazar@ptinovacao.pt
> key id: 0E129E31D803BC61
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
<ps> 
pedro-b-salazar@ptinovacao.pt
key id: 0E129E31D803BC61


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message