Eclipse/Tomcat test environment: Project dependencies/classpath

T

Thomas

Hi,
I have created a Tomcat project within Eclipse containing several
servlets. Accessing the servlets via the webapps (projects) URL works
fine.
Afterwards I created another Tomcat project extending the first one
(first project is checked in the second project's project references.
I have correct web.xml files for both projects. The web.xml for the
2nd project defines servlets contained in the 1st projest. This causes
an error. The classloader apparently cannot find the servlets which
actually belong to the 1st project. No classes that come from the 1st
project are found in the 2nd project at all at runtime (compilation
worked fine so there is no error in the build path).
What do I have to do inorder to connect both projects? I do not want
to copy all servlets and misc classes from the 1st to the 2nd project
but use the 1st project as a foundation for extension projects like
the 2nd one.
Can anyone help?
 
R

Robert Olofsson

Thomas ([email protected]) wrote:
: What do I have to do inorder to connect both projects? I do not want
: to copy all servlets and misc classes from the 1st to the 2nd project
: but use the 1st project as a foundation for extension projects like
: the 2nd one.

I would suggest that you read the class loader howto:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

Basically different web apps can not see each others classes.
Put the classes that need to be shared across several web apps in
the $CATALINA_HOME/shared/classes directory

/robo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top