tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean M. Duncan" <s...@ferrosoft.com>
Subject Re: Help: Context.xml Resource difference between 5.0.x and 5.5.x ?
Date Tue, 18 Jan 2005 01:45:17 GMT
On Mon, 2005-01-17 at 16:57 -0800, TomK wrote:
> I'm having trouble moving my webapp from Tomcat 5.0 to 5.5.  The dataSource in Context.xml
seems to be the issue.
>  
> According to the 'JNDI how-to' documentation for 5.0 and 5.5, it looks like the '<ResourceParams>'
tag has been removed from the Context.xml and instead you can now supply arbitrary attributes
to the <Resource> tag itself.
>  
> In 5.0, my Context.xml looked like this and it worked fine:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context antiResourceLocking="true" docBase="myapp" path="/myapp">
>   <Resource name="jdbc/db1" auth="Container" 
>   type="oracle.jdbc.pool.OracleDataSource" />
>   <ResourceParams name="jdbc/db1">
>     <parameter>
>       <name>factory</name>
>       <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
>     </parameter>
>     <parameter>
>       <name>driverClassName</name>
>       <value>oracle.jdbc.driver.OracleDriver</value>
>     </parameter>
>     <parameter>
>       <name>url</name>
>       <value>jdbc:oracle:thin:@xx:xx:xx</value>
>     </parameter>
>     <parameter>
>       <name>user</name>
>       <value>xx</value>
>     </parameter>
>     <parameter>
>       <name>password</name>
>       <value>xx</value>
>     </parameter>
>   </ResourceParams>
> </Context>
>  
> ...note that oracle's factory requires "user", not "username".    
> 
>  
> Moving to 5.5, I changed it to:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <Context antiResourceLocking="true" docBase="myapp" path="/myapp">
>   <Resource auth="Container" 
>   driverClassName="oracle.jdbc.driver.OracleDriver" 
>   factory="oracle.jdbc.pool.OracleDataSourceFactory" 
>   name="jdbc/db1" 
>   password="xxx" 
>   type="oracle.jdbc.pool.OracleDataSource" 
>   url="jdbc:oracle:thin:@xx:xx:xx" 
>   user="xx"/>
> </Context>
> 
> ...this new Context.xml doesn't work.  I get the following:
> javax.naming.NamingException: Cannot create resource instance
>  at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132)
>  at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
>  at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
>  
> ....any ideas?  Almost seems as if the "factory" attribute of <Resource> is not
being used.
>  
> thanks
> tk_


---------------------------------------------------------------------
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