tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Colebatch <...@bigpond.net.au>
Subject Re: a simple ( irritating) classpath problem
Date Thu, 23 Aug 2001 04:33:53 GMT
hi,

There are three basic areas that classes can be put in tomcat:

WEB-INF/classes
  - contains all the classes that form the web application
WEB-INF/lib
  - contains jars that the web application uses
TOMCAT_HOME/lib
  - contains jars that are available to _all_ applications using tomcat

> because i put all the package (com.oreilly.servlet.*) in the same directory
> with the servlet (under web-inf/classes/ com/servlet/  directory)

if it is the package com.oreilly.servlet then it should go in
WEB-INF/classes/com/oreilly/servlet - even better, I assume you got it as
a jar, just put the jar in WEB-INF/lib .  If it is a zip, then rename it
to a jar.

> i tried putting the cos.jar file in the web-inf/lib directory, it didn't
> work

what do you mean it didn't work?  try jar -tf cos.jar to check that the
classes are in the jar.  I assume you are importing the required classes
and that they exist in the jar.

> in put these files directly under the web-inf/classes/   directory , it
> didn't work either

again, should be according to package

> then i added the full path <tomcat_home>/lib/cos.jar, to the classpath,
> didn't work either.

I'm not sure why that didn't work - although if you put cos.jar in the
classpath it _should_ be available to all web applications.

> well, i gave up, i just wanted to learn the LOGICAL way to set the classpath
> up.

you dont need to set the classpath yourself.  just put your jars in
WEB-INF/lib and your classes in WEB-INF/classes

hth, cheers
dim


Mime
View raw message