Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 99752 invoked from network); 17 Sep 2000 00:06:01 -0000 Received: from unknown (HELO vdcrexc1.orange.ch) (212.215.1.70) by locus.apache.org with SMTP; 17 Sep 2000 00:06:01 -0000 Received: by vdcrexc1.orange.ch with Internet Mail Service (5.5.2650.21) id ; Sat, 16 Sep 2000 20:19:06 +0200 Message-ID: <2B26E094BB13D3118FB3006008214FA5F06F05@vdlaexc0.orange.ch> From: Kitching Simon To: "'tomcat-user@jakarta.apache.org'" Subject: RE: Tomcat an not find JDBC driver on Win98. Date: Sat, 16 Sep 2000 20:18:59 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Nacho [SMTP:nacho@siapi.es] > Sent: Saturday, September 16, 2000 7:37 PM > To: 'tomcat-user@jakarta.apache.org' > Subject: RE: Tomcat an not find JDBC driver on Win98. >=20 > I've deleted the orginal message as it has a JS virus on it, David = take > care of that, please. >=20 > For the Original question, Tomcat do not load zip packed libraris , = from > %TOMCAT_HOME%/lib nor from WEB_INF/lib it only load libraries packed = as > Jars, and the Oracle JDBC drivers are packed as zips so it did not = load > in either dir. >=20 [Kitching Simon] =20 It's not really terribly important, but I stand by my original statements, at least for the HP-UX 11 platform. Tomcat will see *.jar AND *.zip files added to the $TOMCAT_HOME/lib directory. However, it will only see *.jar files in the WEB-INF/lib directory. And that's exactly what David saw on unix: the .zip was loaded when in=20 TOMCAT_HOME/lib but not when in WEB-INF/lib. I tried it too, renaming all my tomcat/lib files (eg servlet.jar) to .zip and tomcat still worked. Perhaps this behaviour could be (or has been) changed in a later release,=20 to avoid exactly the problem that David Xu got? IE load .zips from WEB-INF/lib too. Or a warning about files in WEB-INF/lib being ignored=20 would probably also do the trick..I can understand this being a puzzler. The reason (as described in my earlier msg) is that totally different mechanisms are used; environment params to the JVM versus explicit class-loader- related code. At least I think so, not having actually looked at the code that finds the WEB-INF/lib files myself... There is the following code in "tomcat.sh", called by startup.sh: for i in ${TOMCAT_HOME}/lib/* ; do CLASSPATH=3D${CLASSPATH}:$i done Now the effect of this is to tell the JVM, not tomcat, what path to use and my JVM (sun on HPUX) is happy to accept either .jar or .zip libraries. Well, after all that, it really was hardly worth writing about! I must be trying to avoid doing my real work :-) Simon > The Easiest way to curate this is simply rename your zip files to = jar, i > personally rename class12.zip to class12.zip.jar and everything goes > fine, hope this helps.. >=20 > Saludos , > Ignacio J. Ortega >=20 >=20 > > -----Mensaje original----- > > De: Kitching Simon [mailto:Simon.Kitching@orange.ch] > > Enviado el: s=E1bado 16 de septiembre de 2000 19:30 > > Para: 'tomcat-user@jakarta.apache.org' > > Asunto: RE: Tomcat an not find JDBC driver on Win98. > >=20 > >=20 > > Hi, > >=20 > > > -----Original Message----- > > > From: David Xu [SMTP:david@vendio.com] > > > Sent: Saturday, September 16, 2000 12:37 AM > > > To: tomcat-user@jakarta.apache.org > > > Subject: Tomcat an not find JDBC driver on Win98. > > >=20 > > > I installed Tomcat 3.1 on Win98. Since I want to access=20 > > oracle from my > > > servlet so I put oracle > > > JDBC driver classes111b.zip under ..\tomcat\lib. But my=20 > > servlet complains > > > that the JDBC driver=20 > > > 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 classes111b.zip to the > > > classpath, it works!!! > > > =20 > > > I have set up the same thing on a Linux and put=20 > > classes111b.zip under > > > ../tomcat/lib and it works. > > > =20 > > > Looks to me like Tomcat 3.1 on Win98 can not automatically=20 > > recognize a zip > > > file as a classpath. > > > =20 > > > Can anybody tell me why? > > [Kitching Simon] =20 > >=20 > > There's nothing magical about how tomcat's classpath=20 > > gets set up. > > It's all done with standard shell-script (unix) or=20 > > batch file (win). > >=20 > > Have a look at the difference between "startup.sh" and > > "startup.bat". > >=20 > > startup.sh (used on unix) is clever enough to look for=20 > > all files in > > the > > $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=20 > > non-library files > > in > > this directory! > >=20 > > startup.bat (windows) on the other hand, only adds an=20 > > explicit set > > of files to the classpath. Either the author of this=20 > > wasn't quite as > > clever as the author of startup.sh, or else it simply wasn't > > possible > > to do it in a dos batch file. > >=20 > > So you could just go with your current fix of adding it to the > > classpath > > on windows before calling the tomcat "startup.bat" file. Or you > > could > > hack the tomcat startup.bat file. > >=20 > > I suggest, however, that you put the library in your=20 > > app/WEB-INF/lib > > directory instead; the point of this is that if you=20 > > ever move the > > webapp, > > or make another installation, then you just need to=20 > > copy the wepapp > > directory tree (including WEB-INF) to have a fully-functioning > > webapp > > at the other end. If you have special libs in the=20 > > tomcat directory, > > then > > it's harder to move webapps around. > >=20 > > Two notes:=20 > >=20 > > (a) above you said you tried "webapps/myapp/lib". I presume > > you mean "webapps/myapp/WEB-INF/lib". > >=20 > > (b) I think that tomcat only recognises ".jar" files in the > > WEB-INF/lib > > directory, not ".zip", so try changing the suffix on=20 > > the ".zip" file > > to the standards-compliant ".jar" suffix. They are=20 > > *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 > > happen > > to be compatible at the moment. > >=20 > > Hope this answers your question.. > >=20 > > Regards, > >=20 > > Simon > > > =20 > >=20