aspose file tools*
The moose likes Servlets and the fly likes Tomcat and jar-files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat and jar-files" Watch "Tomcat and jar-files" New topic
Author

Tomcat and jar-files

Mikael Rundqvist
Greenhorn

Joined: Sep 18, 2001
Posts: 7
Can someone confirm or reject if I am right about the below:
"Tomcat requires that all classes which are placed in the default package are deployed in one and the same jar-file placed under <context-root>/WEB-INF/lib/ for the class to be found"
/best regards Mikael
Peter Guillebaud
Ranch Hand

Joined: Jul 11, 2001
Posts: 57
JAR files placed n here will be loaded automatically by the web container, if there are put somewhere else then you must set the CLASSPATH before starting the server.
Mikael Rundqvist
Greenhorn

Joined: Sep 18, 2001
Posts: 7
I will try to clarify a bit what I meant:
I have created two java-beans which belong to the default package but I created to different JAR-files in <docBase>/WEB-INF/lib for them. Then when I wanted to access the beans through the <jsp:useBean id="test1" class="test1"> and <jsp:useBean id="test2" class="test2"> the bean identified by test2 generates an "cannot create bean" error when the page is auto-compiled.
I managed to locate and fix the problem when I put the two beans in the same jar-file and made a correct manifest-file stating that both classes where beans.
Hope that clarifies the pre-conditions for my question.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat and jar-files