Florian, Thanks for the feedback. I'll give it a try!

jfk

-----Original Message-----
From: Kirchhoff, Florian [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 22, 2008 2:52 PM
To: Tomcat Users List
Subject: RE: JDBC driver JARs in a shared production environment

jfk, thank you for the feedback. 

What I found out is that the only way to get the JDBC driver in
WEB-INF/lib to be found by the classloader is if you also place a copy
of commons-dbcp.jar in your WAR AND you modify your context.xml to
include this attribute:

factory="org.apache.commons.dbcp.BasicDataSourceFactory"

I guess this scenario is exactly why the Tomcat dev team has to
repackage the DBCP code into naming-factory-dbcp.jar.

BTW the RH distribution of Tomcat also omits naming-factory-dbcp.jar,
forcing you to use the factory attribute above, even when you
don't include commons-dbcp.jar in your WAR.

Florian

-----Original Message-----
From: Katilie, John [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 22, 2008 2:20 PM
To: Tomcat Users List
Subject: RE: JDBC driver JARs in a shared production environment

It makes sense to put the JDBC driver jars in the war but I had problems
when I had a resource like the following in my context.xml:

<Resource
      name="jdbc/database"
      url="jdbc:mysql://localhost:3306/art"
      driverClassName="com.mysql.jdbc.Driver"
      username="art"
      password="art"
      validationQuery="select 1"
      type="javax.sql.DataSource"
      maxIdle="2"
      maxWait="5000"
      maxActive="4"
  />

And doing a JNDI lookup for the Datasource. I ended up getting Class Not
Found exceptions until I moved the Jar files into the Common Tomcat Lib
directory. This was with Tomcat 6.0.14 and it was about 4-6 months ago.
I've never got back into looking at it closer.

Just food for thought.

jfk 

-----Original Message-----
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Friday, February 22, 2008 12:30 PM
To: Tomcat Users List
Subject: RE: JDBC driver JARs in a shared production environment

> From: Kirchhoff, Florian [mailto:[EMAIL PROTECTED]
> Subject: JDBC driver JARs in a shared production environment
> 
> Question: if you cannot place the JDBC driver jars in 
> CATALINA_HOME/commons/lib, where can you put them?
> 
> 1) Place the JDBC jars in $CATALINA_BASE/jdbc and modify the start-up 
> script to include these jars on the CLASSPATH?
> 2) Deploy the JDBC jars in the WAR file (e.g. WEB-INF/lib/jdbc) and 
> modify the start-up script to include these jar on the CLASSPATH?

NEVER, NEVER, NEVER set CLASSPATH for use with Tomcat.

> 3) Deploy the JDBC jars and commons-dbcp.jar in the WAR in 
> WEB-INF/lib?

Yes.

 - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


This communication is the property of Qwest and may contain confidential
or
privileged information. Unauthorized use of this communication is
strictly 
prohibited and may be unlawful.  If you have received this communication

in error, please immediately notify the sender by reply e-mail and
destroy 
all copies of the communication and any attachments.

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


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

Reply via email to