You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Diego Ballve <di...@digital-artefacts.fi> on 2005/12/19 21:16:46 UTC

JDBC Resources, context file, Tomcat 5.0.x -> 5.5.x

Hello,

I'm trying to migrate a context descriptor for a webapp named omar, from
Tomcat 5.0.x to 5.5.x but I had no luck. This is my new
<tomcat>/conf/Catalina/localhost/omar.xml:

<Context path="/omar" debug="5">
  <Resource name="omar-registry" auth="Container" scope="Shareable"
    type="javax.sql.DataSource"
    url="jdbc:hsqldb:/home/diego/omar/3.0-beta1/data/registry/omar"
    driverClassName="org.hsqldb.jdbcDriver"
    username="sa" password=""
    maxWait="3000" maxIdle="100" maxActive="50"
    removeAbandoned="true" removeAbandonedTimeout="60"
    logAbandoned="true"/>
</Context>

When I try to start the server i get the following in catalina.out:
Cannot create JDBC driver of class '' for connect URL 'null'
        at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
...
which I believe indicates that my resource params were ignored
(considering: class '').

I've tried versions 5.5.9 and 5.5.14-beta. I'm sure the file gets
digested (I had invalid docBase before and I could see the message) and
I'm also sure the jdbc driver jar is in common/lib.

Has anybody succeeded with defining jdbc resource in a context file? Can
anybody spot what I am doing wrong? Do you have any hints on how/what to
debug to find out what's wrong?

Thanks,
Diego


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


Re: JDBC Resources, context file, Tomcat 5.0.x -> 5.5.x

Posted by Bruce Tong <zz...@gmail.com>.
Here's an example that's working for me.

<Context path="/dars" docBase="dars" debug="1" reloadable="true"
crossContext="true">

<Resource
name="jdbc/THEDB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@AAA.BBB.CCC.DDD:EEEE:FFFF"
username="XXXX"
password="YYYY"
maxActive="20"
maxIdle="1"
maxWait="15000"
removeAbandoned="true"
logAbandoned="true"
removeAbandonedTimeout="300"
testOnBorrow="true"
testOnReturn="true"
validationQuery="select 1 from dual"
/>

</Context>



On 12/19/05, Diego Ballve <di...@digital-artefacts.fi> wrote:
>
> Hello,
>
> I'm trying to migrate a context descriptor for a webapp named omar, from
> Tomcat 5.0.x to 5.5.x but I had no luck. This is my new
> <tomcat>/conf/Catalina/localhost/omar.xml:
>
> <Context path="/omar" debug="5">
>   <Resource name="omar-registry" auth="Container" scope="Shareable"
>     type="javax.sql.DataSource"
>     url="jdbc:hsqldb:/home/diego/omar/3.0-beta1/data/registry/omar"
>     driverClassName="org.hsqldb.jdbcDriver"
>     username="sa" password=""
>     maxWait="3000" maxIdle="100" maxActive="50"
>     removeAbandoned="true" removeAbandonedTimeout="60"
>     logAbandoned="true"/>
> </Context>
>
> When I try to start the server i get the following in catalina.out:
> Cannot create JDBC driver of class '' for connect URL 'null'
>         at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(
> BasicDataSource.java:780)
> ...
> which I believe indicates that my resource params were ignored
> (considering: class '').
>
> I've tried versions 5.5.9 and 5.5.14-beta. I'm sure the file gets
> digested (I had invalid docBase before and I could see the message) and
> I'm also sure the jdbc driver jar is in common/lib.
>
> Has anybody succeeded with defining jdbc resource in a context file? Can
> anybody spot what I am doing wrong? Do you have any hints on how/what to
> debug to find out what's wrong?
>
> Thanks,
> Diego
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


--

Bruce Tong