File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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.
 
Consider Paul's rocket mass heater.
 
subject: Tomcat and jar-files
 
Similar Threads
Tag Files
Package import !
Does Anyone Successfully Deploy TLD in JAR
Class NOT FOUND in Tomcat
cannot find javax/crypto/spec/SecretKeySpec class inTomcat 6