tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Deploying mysql-connector-java-5.1.7-bin.jar in /WEB-INF/lib
Date Sun, 23 Nov 2008 21:06:06 GMT
Michael Ludwig wrote:
> Mark Thomas schrieb am 23.11.2008 um 11:25:43 (+0000):
>> IƱigo Mediavilla Saiz wrote:
>>> [Tomcat 6] When I try to access to a Database through the connector
>>> it fails if I leave it inside WEB-INF\lib, but everything works if I
>>> copy the jar in the lib folder of the apache distribution. Is there
>>> any other way to let a web app access to a lib without having to
>>> copy the jar in apache\lib?
>> You can't use Tomcat's built in (DBCP based) connection pooling
>> without placing the JDBC driver jar in CATALINA_HOME/lib.
> 
> You can, via conf/catalina.properties, as explained in my other post on
> this thread. But it is not documented very well.

True. To be more accurate, you can't do what the OP wanted to do unless the JDBC
driver is visible to the common class loader. It has to be visible to the Tomcat
 internals and the webapp.

>> To do what you want, you need to include your own copy of DBCP with
>> your web app and do all the pool configuration in your web app.
> 
> I wonder if there is a scenario in which this would make sense?

- You want to use a different version of DBCP that is provided by Tomcat.
- You want a greater level of independence from the container.

> And wouldn't more memory be required for 5 web apps all loading the same
> classes redundantly instead of relying on the container to do it once
> instead?

Yes.

Mark



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


Mime
View raw message