You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Cathrow <ac...@seagull.nl> on 2000/05/02 08:02:37 UTC

RE: JDBC & Tomcat / JAR's

with the final release of 3.1 I've had no problems with Tomcat recognising
JAR files in the ./lib directory - without any need to expand them or
explicitly name them. I have had some problems with ZIP files though.

I think that you are using the wrong lib directory.
The /opt/tomcat/lib directory is tomcat's own library directory. The one for
servlet specific jar's is located inside the webapp -
ie. ./WEB-INF/lib jar's placed in this directory are automatically added to
the classpath.
But strangely not zip files ....

-----Original Message-----
From: Giles Chanot (LeafInternet.com) [mailto:giles@leafinternet.com]
Sent: 01 May 2000 23:59
To: tomcat-user@jakarta.apache.org
Subject: RE: JDBC & Tomcat


Hi,

just to clarify slighty, I think if the JDBC (or any other) classes that you
want to include are in a JAR file, then you need to explicity specify the
JAR file in the CLASSPATH environment variable that Tomcat sees, i.e.

export CLASSPATH = ${CLASSPATH}:/usr/local/mysql/jdbc/drivers.jar (or
whatever)

But if the class files are not in a JAR file (or you choose to unpack them
from the JAR file) then placing them in /opt/tomcat/lib will automatically
make them included, as /opt/tomcat/lib is already in CLASSPATH, but you must
preserve the directory structure as in the JAR file, so for example the
class org.gjt.mm.mysql.Driver would be in

/opt/tomcat/lib/org/gjt/mm/mysql/Driver.class

Hope this helps,
Giles

Marcos Martinez writes:
 > i think that you have not understand my question, i talked about, the
 > place (path directory) where i need to put the *.jar files of the
 > third-party JDBC drivers, like mSQL, MYSQL, etc....
You can put them them where you want, as long as you include them in the
CLASSPATH.


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Re: JDBC & Tomcat / JAR's

Posted by Craig McClanahan <Cr...@eng.sun.com>.
Jason & Golda Hoffman wrote:

> I tried it, as well as unpacking the zip file and repacking it as a jar.  I
> ended up unziping the directory structure and moving it into the classes
> directory under the webapp.  That worked.
>
> It was almost as if the webapp/WEB-INF/lib directory was not really in the
> CLASSPATH. ( Tomcat 3.1 )
>

Just to nit-pick, the WEB-INF/lib directory itself is *not* put in the class
path, but individual JAR files (not ZIP files) within the directory *are* put in
the class path.  The WEB-INF/classes directory as a whole (for classes that are
not archived) is also added.

These rules are based on the requirements of the servlet spec (version 2.2), and
are portable to all conforming servlet containers.

Craig McClanahan



Re: JDBC & Tomcat / JAR's

Posted by Jason & Golda Hoffman <ho...@dfw.net>.
I tried it, as well as unpacking the zip file and repacking it as a jar.  I
ended up unziping the directory structure and moving it into the classes
directory under the webapp.  That worked.

It was almost as if the webapp/WEB-INF/lib directory was not really in the
CLASSPATH. ( Tomcat 3.1 )

George McKInney wrote:

> RE: the .zip files: Has anyone simply tried renaming foo.zip to foo.jar? or
> perhaps to foo.zip.jar to make them easier to keep track of?
>
> George McKinney, Developer
> tantalus communications inc.
> 500-1122 Mainland Street
> Vancouver, BC, Canada V6B 5L1
> george@tantalus.com
>
> Direct  604.726.6753
> Main    604.609.0700
> Fax     604.609.0705
> www.tantalus.com
> "When eBusiness experience counts."
>
> -----Original Message-----
> From: Andrew Cathrow [mailto:acathrow@seagull.nl]
> Sent: Monday, May 01, 2000 11:03 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: JDBC & Tomcat / JAR's
>
> with the final release of 3.1 I've had no problems with Tomcat recognising
> JAR files in the ./lib directory - without any need to expand them or
> explicitly name them. I have had some problems with ZIP files though.
>
> I think that you are using the wrong lib directory.
> The /opt/tomcat/lib directory is tomcat's own library directory. The one for
> servlet specific jar's is located inside the webapp -
> ie. ./WEB-INF/lib jar's placed in this directory are automatically added to
> the classpath.
> But strangely not zip files ....
>
> -----Original Message-----
> From: Giles Chanot (LeafInternet.com) [mailto:giles@leafinternet.com]
> Sent: 01 May 2000 23:59
> To: tomcat-user@jakarta.apache.org
> Subject: RE: JDBC & Tomcat
>
> Hi,
>
> just to clarify slighty, I think if the JDBC (or any other) classes that you
> want to include are in a JAR file, then you need to explicity specify the
> JAR file in the CLASSPATH environment variable that Tomcat sees, i.e.
>
> export CLASSPATH = ${CLASSPATH}:/usr/local/mysql/jdbc/drivers.jar (or
> whatever)
>
> But if the class files are not in a JAR file (or you choose to unpack them
> from the JAR file) then placing them in /opt/tomcat/lib will automatically
> make them included, as /opt/tomcat/lib is already in CLASSPATH, but you must
> preserve the directory structure as in the JAR file, so for example the
> class org.gjt.mm.mysql.Driver would be in
>
> /opt/tomcat/lib/org/gjt/mm/mysql/Driver.class
>
> Hope this helps,
> Giles
>
> Marcos Martinez writes:
>  > i think that you have not understand my question, i talked about, the
>  > place (path directory) where i need to put the *.jar files of the
>  > third-party JDBC drivers, like mSQL, MYSQL, etc....
> You can put them them where you want, as long as you include them in the
> CLASSPATH.
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org


RE: JDBC & Tomcat / JAR's

Posted by George McKInney <ge...@tantalus.com>.
RE: the .zip files: Has anyone simply tried renaming foo.zip to foo.jar? or
perhaps to foo.zip.jar to make them easier to keep track of?

George McKinney, Developer
tantalus communications inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705
www.tantalus.com
"When eBusiness experience counts."


-----Original Message-----
From: Andrew Cathrow [mailto:acathrow@seagull.nl]
Sent: Monday, May 01, 2000 11:03 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: JDBC & Tomcat / JAR's


with the final release of 3.1 I've had no problems with Tomcat recognising
JAR files in the ./lib directory - without any need to expand them or
explicitly name them. I have had some problems with ZIP files though.

I think that you are using the wrong lib directory.
The /opt/tomcat/lib directory is tomcat's own library directory. The one for
servlet specific jar's is located inside the webapp -
ie. ./WEB-INF/lib jar's placed in this directory are automatically added to
the classpath.
But strangely not zip files ....

-----Original Message-----
From: Giles Chanot (LeafInternet.com) [mailto:giles@leafinternet.com]
Sent: 01 May 2000 23:59
To: tomcat-user@jakarta.apache.org
Subject: RE: JDBC & Tomcat


Hi,

just to clarify slighty, I think if the JDBC (or any other) classes that you
want to include are in a JAR file, then you need to explicity specify the
JAR file in the CLASSPATH environment variable that Tomcat sees, i.e.

export CLASSPATH = ${CLASSPATH}:/usr/local/mysql/jdbc/drivers.jar (or
whatever)

But if the class files are not in a JAR file (or you choose to unpack them
from the JAR file) then placing them in /opt/tomcat/lib will automatically
make them included, as /opt/tomcat/lib is already in CLASSPATH, but you must
preserve the directory structure as in the JAR file, so for example the
class org.gjt.mm.mysql.Driver would be in

/opt/tomcat/lib/org/gjt/mm/mysql/Driver.class

Hope this helps,
Giles

Marcos Martinez writes:
 > i think that you have not understand my question, i talked about, the
 > place (path directory) where i need to put the *.jar files of the
 > third-party JDBC drivers, like mSQL, MYSQL, etc....
You can put them them where you want, as long as you include them in the
CLASSPATH.


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org