tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat5w GUI application
Date Wed, 18 May 2011 16:18:38 GMT
Hash: SHA1


On 5/18/2011 5:18 AM, Venky Vasant wrote:
> However another question, i have jdbc drivers in the classpath, i tired 
> copying whole folder under WEB-INF it was not picked up.
> i did not try copying the sqljdbc.jar right under web-inf as i am not very sure 
> of how other file like .dll get used.

If you are using Tomcat's connection-pooling mechanism, you'll need to
place your JDBC library any any supporting libraries (such as native
libs) under CATALINA_BASE/common and take care NOT to put them into your
webapp's WEB-INF/lib directory. That's an unfortunate requirement of
Tomcat's connection pooling mechanism.

If you are NOT using Tomcat's connection-pooling, then you should put
all those libraries into your webapp's WEB-INF/lib directory.

Tomcat basically builds all "class paths" (that is, locations where
libraries are located, not to be confused with the actual CLASSPATH
environment variable which you should pretty much never use) in a smart,
safe, and sane way. You should just follow the rules and everything
should be okay. Those rules are, roughly:

1. Don't set the CLASSPATH environment variable and/or
   Don't change the CLASSPATH setting in the service configuration
2. Put all the libraries your webapp needs into the webapp's WEB-INF/lib

That's basically it. The fact that your webapp uses some particular JDBC
driver is technically irrelevant: the server should provide a JDBC
DataSource to your webapp and the server should configure it. That's why
the server needs to have access to the JDBC library itself instead of it
being stuck in your webapp's WEB-INF/lib directory.

By the way, yuck: whose JDBC library requires a native library these
days? Is that Microsoft SQL Server. I thought they had a pure-Java driver.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message