tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <>
Subject RE: Tomcat an not find JDBC driver on Win98.
Date Sat, 16 Sep 2000 17:30:09 GMT

> -----Original Message-----
> From:	David Xu []
> Sent:	Saturday, September 16, 2000 12:37 AM
> To:
> Subject:	Tomcat an not find JDBC driver on Win98.
> I installed Tomcat 3.1 on Win98. Since I want to access oracle from my
> servlet so I put oracle
> JDBC driver under ..\tomcat\lib. But my servlet complains
> that the JDBC driver 
> class can not be found. So I put the same zip file under
> ..\webapps\myapp\lib, it still won't work.
> Finally, I modified the tomcat.bat to add to the
> classpath, it works!!!
> I have set up the same thing on a Linux and put under
> ../tomcat/lib and it works.
> Looks to me like Tomcat 3.1 on Win98 can not automatically recognize a zip
> file as a classpath.
> Can anybody tell me why?
	[Kitching Simon]  

	There's nothing magical about how tomcat's classpath gets set up.
	It's all done with standard shell-script (unix) or batch file (win).

	Have a look at the difference between "" and
"startup.bat". (used on unix) is clever enough to look for all files in
	$TOMCAT_HOME/lib directory, and add them all to the CLASSPATH
	environment variable. Note that it doesn't care at all what the
suffix is,
	any file gets added to the path, so better not put non-library files
	this directory!

	startup.bat (windows) on the other hand, only adds an explicit set
	of files to the classpath. Either the author of this wasn't quite as
	clever as the author of, or else it simply wasn't
	to do it in a dos batch file.

	So you could just go with your current fix of adding it to the
	on windows before calling the tomcat "startup.bat" file. Or you
	hack the tomcat startup.bat file.

	I suggest, however, that you put the library in your app/WEB-INF/lib
	directory instead; the point of this is that if you ever move the
	or make another installation, then you just need to copy the wepapp
	directory tree (including WEB-INF) to have a fully-functioning
	at the other end. If you have special libs in the tomcat directory,
	it's harder to move webapps around.

	Two notes: 

	(a) above you said you tried "webapps/myapp/lib". I presume
	you mean "webapps/myapp/WEB-INF/lib".

	(b) I think that tomcat only recognises ".jar" files in the
	directory, not ".zip", so try changing the suffix on the ".zip" file
	to the standards-compliant ".jar" suffix. They are *not* the same,
	although windows developers tend to treat them as identical. One
	is a compression format, one is a java archive file - they just
	to be compatible at the moment.

	Hope this answers your question..



View raw message