You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John MccLain <jm...@tcshealthcare.com> on 2004/10/14 02:47:25 UTC
DBCP doesn't see .jar in context ???
I am trying to use the DriverAdapterCPDS in DBCP. When I run my eclipse app
standalone to test my class, the cpds.setDriver(strDriver); function works
fine,
and I know it is because Eclipse appends all my .jar files (all in
WEB-INF/lib) to the classpath.
However, When I kick off tomcat, my classpath is set to Bootstrap.jar (and
eclipse adds tools.jar)
and my JDBC driver .jar is NO LONGER in the classpath. My servlet init()
function does a e.printstacktrace, and I
get a NoClassDefFound error.
What I find strange is that, if I do a Class.forName( stDatabaseDriver ); IN
THE SERVLETS DOPOST,
the driver is available.
Is this because the context and the servlets have to be completely loaded to
recognize jar files in WEB-INF/lib??
I know this can be solved by putting my driver .jar file in the
tomcat/common/lib directory, but I would prefer not
to do that. I would prefer to have all my project related .jar files in
WEB-INF/lib.
How can I get the DBCP to see the driver .jar in WEB-INF/lib when I
instantiate it in a context startup listener or
servlet init() function?
Is there a way to change the classpath dynamically?
John McClain
Senior Software Engineer
TCS Healthcare
jmcclain@tcshealthcare.com
(530)886-1700x235
"Before you criticize someone, walk a mile in their shoes.
That way, you'll be a mile from them, and you'll have their shoes."
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org