File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Classpath question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Classpath question" Watch "Classpath question" New topic
Author

Classpath question

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Hi, I am having trouble setting up my classpath on Tomcat. I am receiving errors for log4j and hibernate.cfg.xml. Apparently they are not being found in the classpath.
I have a few questions:

1. Do I have to use the common/lib directory or can I use webapps/<mywebApp>/lib? I would prefer the latter since there are several other projects under Tomcat.

2. Is there java code I could use for debugging? In the past I have tried <%=System.getProperty("java.class.path") %>.

3. I am adding all of my jars and property files in webapps/<mywebApp>/lib. Will these get picked up and added to the classpath on startup?

Thanks!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat only looks for Jar files under WEB-INF/lib.

Put your log4j.properties file (and any other file that needs to be on the classpath) in WEB-INF/classes


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
 
subject: Classpath question
 
Similar Threads
cannot find resource - servlet
Custom WebApp servlet url problem
JSTL and EL
UnpackWAR
Application classpath