You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ve...@trilogy.com on 2004/11/13 06:03:24 UTC
Problem with classpaths
Hi,
I'm using tomcat 4.1 for our application, the problem i'm facing is that
tomcat is often unable to find the classes present in my application and
also certain classes like javax.servlet.HttpServlet,
com.objectspace.jgl.Sequence etc... However, I've placed all the classes
and jars in the appropriate folders.
I've placed all my classes in
<CATALINA_HOME>/webapps/myapp/WEB-INF/classes
I've placed all my jars including the jgl3.1.0.jar(that contains
com.objectspace.jgl.Sequence) in <CATALINA_HOME>/webapps/myapp/WEB-INF/lib
and all the other commonly used jars including the servlet.jar (contains
javax.servlet.HttpServlet) in <CATALINA_HOME>/common/lib/
If I don't include the servlet.jar in my CLASSPATH, I get a no class def
found error for HttpServlet and once I include servlet.jar, I get a
noclassdef found error for Sequence. Can anybody please tell me as to how
the CLASSPATH works for tomcat and what all should I include in
classpath... I would be grateful for the info u provide... This problem is
bugging me since the past 2 days :-(
-Venkatesh
Re: Problem with classpaths
Posted by QM <qm...@brandxdev.net>.
On Sat, Nov 13, 2004 at 10:33:24AM +0530, Venkatesh.Babu@trilogy.com wrote:
: I've placed all my classes in
: <CATALINA_HOME>/webapps/myapp/WEB-INF/classes
: I've placed all my jars including the jgl3.1.0.jar(that contains
: com.objectspace.jgl.Sequence) in <CATALINA_HOME>/webapps/myapp/WEB-INF/lib
:
: and all the other commonly used jars including the servlet.jar (contains
: javax.servlet.HttpServlet) in <CATALINA_HOME>/common/lib/
Do you have two copies of servlet.jar (or another JAR file that contains
servlet classes) elsewhere? That would cause all sorts of classloader
problems.
: If I don't include the servlet.jar in my CLASSPATH, I get a no class def
: found error for HttpServlet and once I include servlet.jar, I get a
: noclassdef found error for Sequence.
Be careful how you use the term CLASSPATH -- you don't set this variable
explicitly when you use Tomcat. Follow the guidelines and place JAR
files or classes under certain directories (e.g. {context}/WEB-INF/lib,
{tomcat}/common/lib, etc).
: Can anybody please tell me as to how
: the CLASSPATH works for tomcat and what all should I include in
: classpath... I would be grateful for the info u provide... This problem is
: bugging me since the past 2 days :-(
There's a classloader doc on the Tomcat website.
-QM
--
software -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org