You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dhiren Bhatia <dh...@gmail.com> on 2010/03/09 17:48:19 UTC

Commons DBCP in Tomcat 6.x

Hi,

I'm trying to use the commons DBCP package with Tomcat 6.x. I know that the
tomcat_dbcp.jar has the commons files renamed, however I would prefer to use
the commons jar files so I can use the class
org.apache.commons.dbcp.BasicDataSource in my code.

To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib and
replaced it with the commons jar file. I assumed that the class loader would
pick it up like it did in the earlier version of tomcat but that doesn't
seem to happen. I still get an ClassCastException since tomcat tries to cast
the org.apache.commons.dbcp.BasicDataSource to
org.apache.tomcat.dbcp.dbcp.BasicDataSource.

Is there any way I can force Tomcat 6.x to load my commons dbcp jar instead
of the tomcat_dbcp.jar which comes with the distro?

Thanks!
Dhiren

Re: Commons DBCP in Tomcat 6.x

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dhiren,

On 3/9/2010 11:48 AM, Dhiren Bhatia wrote:
> I'm trying to use the commons DBCP package with Tomcat 6.x. I know that the
> tomcat_dbcp.jar has the commons files renamed, however I would prefer to use
> the commons jar files so I can use the class
> org.apache.commons.dbcp.BasicDataSource in my code.

You could also use org.apache.tomcat.dbcp.dbcp.BasicDataSource, which is
the one provided by Tomcat.

> To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib and
> replaced it with the commons jar file.

Why would you do that? Tomcat re-packages DBCP under a different package
structure precisely so that you can have both libraries installed at once.

> I assumed that the class loader would
> pick it up like it did in the earlier version of tomcat but that doesn't
> seem to happen. I still get an ClassCastException since tomcat tries to cast
> the org.apache.commons.dbcp.BasicDataSource to
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.

What's crazy is that you didn't get a ClassNotFoundException looking for
org.apache.tomcat.dbcp.dbcp.BasicDataSource.

> Is there any way I can force Tomcat 6.x to load my commons dbcp jar instead
> of the tomcat_dbcp.jar which comes with the distro?

You don't want it to load commons-dbcp.jar /instead of/
tomcat-dbcp.jar... you want it to load both.

But, that won't solve your problem: can you post the code that you use
to use BasicDataSource in your code (including imports)?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuWhS0ACgkQ9CaO5/Lv0PCfkQCeOw0+p5poGdFKaOr7WBaSDT3j
p8sAoI/jj5RcasUjo/1oAEAqc4uGid3P
=rneK
-----END PGP SIGNATURE-----

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


Re: Commons DBCP in Tomcat 6.x

Posted by Mark Shifman <ma...@yale.edu>.
http://marc.info/?l=tomcat-user&m=126772163323329&w=2
This article claims you can set a startup option... but I haven't tried it.
mas

Dhiren Bhatia wrote:
> Hi,
> 
> I'm trying to use the commons DBCP package with Tomcat 6.x. I know that the
> tomcat_dbcp.jar has the commons files renamed, however I would prefer to use
> the commons jar files so I can use the class
> org.apache.commons.dbcp.BasicDataSource in my code.
> 
> To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib and
> replaced it with the commons jar file. I assumed that the class loader would
> pick it up like it did in the earlier version of tomcat but that doesn't
> seem to happen. I still get an ClassCastException since tomcat tries to cast
> the org.apache.commons.dbcp.BasicDataSource to
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.
> 
> Is there any way I can force Tomcat 6.x to load my commons dbcp jar instead
> of the tomcat_dbcp.jar which comes with the distro?
> 
> Thanks!
> Dhiren
> 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu

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


RE: Commons DBCP in Tomcat 6.x

Posted by "Propes, Barry L " <ba...@citi.com>.
And in TC 6, versus the 4 series and older versions, you should be able to cram all of the Resource params into one element or attribute tag. 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, March 09, 2010 2:36 PM
To: Tomcat Users List
Subject: RE: Commons DBCP in Tomcat 6.x

> From: Dhiren Bhatia [mailto:dhiren.forums@gmail.com]
> Subject: Re: Commons DBCP in Tomcat 6.x
> 
> <Context path="/myapp" docBase="myapp" debug="0"
> reloadable="true" crossContext="true">

<Context> elements should not be placed in server.xml:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

> <Resource name="jdbc/myserver" auth="Container"
> type="javax.sql.DataSource" />

To re-emphasize Konstantin's comment:

> > > Note, that you have to specify className="..." explicitly.

> <ResourceParams name="jdbc/myserver">

This is completely wrong.  <ResourceParams> haven't been used in ages; you might try reading the documentation for the level of Tomcat you're using:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

Looks like you're following some very, very out of date documentation or examples.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


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


RE: Commons DBCP in Tomcat 6.x

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dhiren Bhatia [mailto:dhiren.forums@gmail.com]
> Subject: Re: Commons DBCP in Tomcat 6.x
> 
> <Context path="/myapp" docBase="myapp" debug="0"
> reloadable="true" crossContext="true">

<Context> elements should not be placed in server.xml:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

> <Resource name="jdbc/myserver" auth="Container"
> type="javax.sql.DataSource" />

To re-emphasize Konstantin's comment:

> > > Note, that you have to specify className="..." explicitly.

> <ResourceParams name="jdbc/myserver">

This is completely wrong.  <ResourceParams> haven't been used in ages; you might try reading the documentation for the level of Tomcat you're using:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

Looks like you're following some very, very out of date documentation or examples.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Commons DBCP in Tomcat 6.x

Posted by Dhiren Bhatia <dh...@gmail.com>.
Thanks for the feedback, I've updated the Resource Tag and moved Context to
META_INF. I've also changed the code to use javax.sql.DataSource. Is there
any way to get the number of active/idle connections like you can with the
BasicDataSource object's methods getNumActive etc? How do I get information
on the status of the connection pool?

Thanks!

On Tue, Mar 9, 2010 at 1:14 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Christopher Schultz [mailto:chris@christopherschultz.net]
> > Subject: Re: Commons DBCP in Tomcat 6.x
> >
> > <ResourceParams name="jdbc/myserver">
> >
> > Again, as Chuck suggests, this is the long way of doing resource
> > parameters. You can shove all this stuff into <Resource>, now.
>
> It's not the long way - it simply doesn't work in 5.5 and above.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>

RE: Commons DBCP in Tomcat 6.x

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Subject: Re: Commons DBCP in Tomcat 6.x
> 
> <ResourceParams name="jdbc/myserver">
> 
> Again, as Chuck suggests, this is the long way of doing resource
> parameters. You can shove all this stuff into <Resource>, now.

It's not the long way - it simply doesn't work in 5.5 and above.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


Re: Commons DBCP in Tomcat 6.x

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dhiren,

On 3/9/2010 3:19 PM, Dhiren Bhatia wrote:
> The Resource is defined as follows in the server.xml file:

As Chuck suggests, move <Context> from server.xml to
META-INF/context.xml in your webapp.

>             <Context path="/myapp" docBase="myapp" debug="0"
> reloadable="true"
>                     crossContext="true">

When you move <Context> as described above, remove both the "path" and
"docBase" attributes. "debug" does nothing, BTW.

>                     <Resource name="jdbc/myserver" auth="Container"
>                         type="javax.sql.DataSource" />

Specifying java.sql.DataSource as the resource type means that Tomcat
will create a org.apache.tomcat.dbcp.dbcp.BasicDataSource object. If you
want a different type of object, you'll need to specify the /factory/
for the objects as well. Check the <Resource> documentation for how to
do that.

>                     <ResourceParams name="jdbc/myserver">

Again, as Chuck suggests, this is the long way of doing resource
parameters. You can shove all this stuff into <Resource>, now.

>                         <parameter>
>                             <name>factory</name>
> 
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>                         </parameter>

This might not work given the preference of <Resource> over
<ResourceParams>. I'm not even sure if <ResourceParams> are used at
all... Tomcat might be ignoring them.

>                     </ResourceParams>

I noticed that you didn't specify the username and password for the
connection pool, here. Instead, you have it in your code:

> import org.apache.commons.dbcp.BasicDataSource;
> 
> private static BasicDataSource            ds                    = null;
> 
>             Properties dbProps = new Properties();
>             dbProps.load(new FileInputStream(dbConfFilePath));
>             ds = (BasicDataSource) ctx.lookup("java:comp/env/"
>                     + dbProps.getProperty(RESOURCE_NAME_KEY));
>             ds.setDriverClassName(dbProps.getProperty(DRIVER_KEY));
>             ds.setUrl(getJdbcUrl(dbProps));
>             ds.setUsername(dbProps.getProperty(USERNAME_KEY));
>             ds.setPassword(dbProps.getProperty(PASSWORD_KEY));

Why bother setting the driver class, url, username, and password in your
webapp when the <Resource> element in context.xml can do it for you? You
are just making your life more difficult by doing this.

If you have a good reason to do this, let us know and we'll help you
around it. Otherwise, I'd say just use context.xml to configure your
DataSource and forget all the code you have above: just use
javax.sql.DataSource to get connections that are already connected.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuWuZgACgkQ9CaO5/Lv0PBj1gCgnvo863ZwGWGEjaOWMzqR66F9
u8AAnRw2ZlxplpU2+jaL6jO9qOfbexjC
=0vjq
-----END PGP SIGNATURE-----

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


Re: Commons DBCP in Tomcat 6.x

Posted by Dhiren Bhatia <dh...@gmail.com>.
The Resource is defined as follows in the server.xml file:

            <Context path="/myapp" docBase="myapp" debug="0"
reloadable="true"
                    crossContext="true">

                    <Resource name="jdbc/myserver" auth="Container"
                        type="javax.sql.DataSource" />

                    <ResourceParams name="jdbc/myserver">
                        <parameter>
                            <name>factory</name>

<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                        </parameter>

                        <!--
                            Maximum number of dB connections in pool. Make
sure you configure
                            your mysqld max_connections large enough to
handle all of your db
                            connections. Set to 0 for no limit.
                        -->
                        <parameter>
                            <name>maxActive</name>
                            <value>100</value>
                        </parameter>

                        <!--
                            Maximum number of idle dB connections to retain
in pool. Set to 0
                            for no limit.
                        -->
                        <parameter>
                            <name>maxIdle</name>
                            <value>30</value>
                        </parameter>

                        <!--
                            The following 3 parameters are set to prevent DB
connection pool
                            leaks
                        -->
                        <parameter>
                            <name>removeAbandoned</name>
                            <value>true</value>
                        </parameter>

                        <parameter>
                            <name>removeAbandonedTimeout</name>
                            <value>60</value>
                        </parameter>

                        <parameter>
                            <name>logAbandoned</name>
                            <value>true</value>
                        </parameter>

                        <!--
                            Maximum time to wait for a dB connection to
become available in
                            ms, in this example 10 seconds. An Exception is
thrown if this
                            timeout is exceeded. Set to -1 to wait
indefinitely.
                        -->
                        <parameter>
                            <name>maxWait</name>
                            <value>10000</value>
                        </parameter>

                    </ResourceParams>
                </Context>

On Tue, Mar 9, 2010 at 12:07 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Dhiren Bhatia [mailto:dhiren.forums@gmail.com]
> > Subject: Re: Commons DBCP in Tomcat 6.x
> >
> > Why is it looking for
> > org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory?
>
> For us to answer that, you need to pay attention to Konstantin's question:
>
> > > -----Original Message-----
> > > From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
> > > Subject: Re: Commons DBCP in Tomcat 6.x
> > >
> > > 1. How is your <Resource> is defined. Please show us
> > > (remove any passwords).
> > > Note, that you have to specify className="..." explicitly.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Commons DBCP in Tomcat 6.x

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dhiren Bhatia [mailto:dhiren.forums@gmail.com]
> Subject: Re: Commons DBCP in Tomcat 6.x
> 
> Why is it looking for
> org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory?

For us to answer that, you need to pay attention to Konstantin's question:

> > -----Original Message-----
> > From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
> > Subject: Re: Commons DBCP in Tomcat 6.x
> >
> > 1. How is your <Resource> is defined. Please show us
> > (remove any passwords).
> > Note, that you have to specify className="..." explicitly.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Commons DBCP in Tomcat 6.x

Posted by Dhiren Bhatia <dh...@gmail.com>.
Here's the exception I get with the tomcat_dbcp.jar file in lib:

java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource
cannot be cast to org.apache.commons.dbcp.BasicDataSource

When I remove the tomcat_dbcp.jar file from lib, I get this exception:
javax.naming.NamingException: Could not create resource factory instance
[Root exception is java.lang.ClassNotFoundException:
org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory

Why is it looking for org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory? i
would expect it to try and instantiate the BasicDataSourceFactory in the
commons dbcp package. Am I missing something?

I don't want to use the org.apache.tomcat.dbcp.dbcp.BasicDataSource class in
my code because I need my application to be independent of the server. We're
using eclipse to develop, which uses an embedded jetty, so i won't be able
to run this code while debugging in eclipse.

Here's what the code looks like:

import org.apache.commons.dbcp.BasicDataSource;

private static BasicDataSource            ds                    = null;

            Properties dbProps = new Properties();
            dbProps.load(new FileInputStream(dbConfFilePath));
            ds = (BasicDataSource) ctx.lookup("java:comp/env/"
                    + dbProps.getProperty(RESOURCE_NAME_KEY));
            ds.setDriverClassName(dbProps.getProperty(DRIVER_KEY));
            ds.setUrl(getJdbcUrl(dbProps));
            ds.setUsername(dbProps.getProperty(USERNAME_KEY));
            ds.setPassword(dbProps.getProperty(PASSWORD_KEY));


Thanks!

On Tue, Mar 9, 2010 at 10:16 AM, Propes, Barry L <ba...@citi.com>wrote:

> I was initially getting this error, too, with my first install, but rebuilt
> the Tomcat collection and finally vanquished it using the factory reference
> of org.apache.tomcat.dbcp.DataSourceConnectionFactory in there, even though
> I'd initially gotten an error not being able to create the factory resource.
>
> Now I'm only getting a naming context error. If I get that fixed, I'll be
> on my way.
>
>
>
> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
> Sent: Tuesday, March 09, 2010 11:38 AM
> To: Tomcat Users List
> Subject: Re: Commons DBCP in Tomcat 6.x
>
> 2010/3/9 Dhiren Bhatia <dh...@gmail.com>:
> > Hi,
> >
> > I'm trying to use the commons DBCP package with Tomcat 6.x. I know
> > that the tomcat_dbcp.jar has the commons files renamed, however I
> > would prefer to use the commons jar files so I can use the class
> > org.apache.commons.dbcp.BasicDataSource in my code.
> >
> > To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib
> > and replaced it with the commons jar file. I assumed that the class
> > loader would pick it up like it did in the earlier version of tomcat
> > but that doesn't seem to happen. I still get an ClassCastException
> > since tomcat tries to cast the org.apache.commons.dbcp.BasicDataSource
> > to org.apache.tomcat.dbcp.dbcp.BasicDataSource.
> >
> > Is there any way I can force Tomcat 6.x to load my commons dbcp jar
> > instead of the tomcat_dbcp.jar which comes with the distro?
> >
>
> 1. How is your <Resource> is defined. Please show us (remove any
> passwords).
> Note, that you have to specify className="..." explicitly.
>
> 2. What, exactly, stack trace you are getting?
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Commons DBCP in Tomcat 6.x

Posted by "Propes, Barry L " <ba...@citi.com>.
I was initially getting this error, too, with my first install, but rebuilt the Tomcat collection and finally vanquished it using the factory reference of org.apache.tomcat.dbcp.DataSourceConnectionFactory in there, even though I'd initially gotten an error not being able to create the factory resource.

Now I'm only getting a naming context error. If I get that fixed, I'll be on my way.

 

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Tuesday, March 09, 2010 11:38 AM
To: Tomcat Users List
Subject: Re: Commons DBCP in Tomcat 6.x

2010/3/9 Dhiren Bhatia <dh...@gmail.com>:
> Hi,
>
> I'm trying to use the commons DBCP package with Tomcat 6.x. I know 
> that the tomcat_dbcp.jar has the commons files renamed, however I 
> would prefer to use the commons jar files so I can use the class 
> org.apache.commons.dbcp.BasicDataSource in my code.
>
> To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib 
> and replaced it with the commons jar file. I assumed that the class 
> loader would pick it up like it did in the earlier version of tomcat 
> but that doesn't seem to happen. I still get an ClassCastException 
> since tomcat tries to cast the org.apache.commons.dbcp.BasicDataSource 
> to org.apache.tomcat.dbcp.dbcp.BasicDataSource.
>
> Is there any way I can force Tomcat 6.x to load my commons dbcp jar 
> instead of the tomcat_dbcp.jar which comes with the distro?
>

1. How is your <Resource> is defined. Please show us (remove any passwords).
Note, that you have to specify className="..." explicitly.

2. What, exactly, stack trace you are getting?

Best regards,
Konstantin Kolinko

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


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


Re: Commons DBCP in Tomcat 6.x

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/3/9 Dhiren Bhatia <dh...@gmail.com>:
> Hi,
>
> I'm trying to use the commons DBCP package with Tomcat 6.x. I know that the
> tomcat_dbcp.jar has the commons files renamed, however I would prefer to use
> the commons jar files so I can use the class
> org.apache.commons.dbcp.BasicDataSource in my code.
>
> To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib and
> replaced it with the commons jar file. I assumed that the class loader would
> pick it up like it did in the earlier version of tomcat but that doesn't
> seem to happen. I still get an ClassCastException since tomcat tries to cast
> the org.apache.commons.dbcp.BasicDataSource to
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.
>
> Is there any way I can force Tomcat 6.x to load my commons dbcp jar instead
> of the tomcat_dbcp.jar which comes with the distro?
>

1. How is your <Resource> is defined. Please show us (remove any passwords).
Note, that you have to specify className="..." explicitly.

2. What, exactly, stack trace you are getting?

Best regards,
Konstantin Kolinko

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