This week's book giveaway is in the Java in General forum. We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line! See this thread for details.
First off, I did a search in the tomcat forum for this problem, although a similar question has been posed by someone, no answer has been given. May be someone can help here... I have a WAR file which I created by running the jar command as follows: jar cvf Prep.WAR . I ran this command from within the Prep directory. I placed the resulting WAR file in webapps and started tomcat. Two things: 1. Prep.war is not getting expanded - I have other WARs that do expand. 2. I have a login.jsp in the app and I am running it as: http://localhost:8080/Prep/login.jsp and I get a resource not found error. What am I doing wrong here ? I can run the app fine in an unpackaged fashion. Any help is greatly appreciated. Thanks ! Regards, Sri
1. Are you sure that the unpackWARs attribute is set in servers.xml - example:
2. Try deleting the Prep directory - if Tomcat sees that the directory exists it will not expand the WAR because it thinks it has already been done.
3.I suspect that the JSP is not served because the Prep directory is not recognized as a "web application" - does it have a WEB-INF and a web.xml? Bill [ December 09, 2003: Message edited by: William Brogden ]
Bill, I figured out the problem ! I had to remove this from server.xml, that I had previously added: <Context path="/Prep" docBase="Prep" debug="0" reloadable="true" /> Do you know why I had to do this? Note that, If I run the app in the regular fashion i.e without the WAR, the above can be in server.xml: -Sri
tomcat only unpacks WARS where the context doesn't already exist, so your context line made it think it was already there. if you make a new WAR and need to unpack it again the easiest way is to go into the tomcat manager (linked from localhost:8080/index.jsp if you have tomcat demo stuff installed) and find your context in the list and click REMOVE. however this DELETES the context folder completely so make sure you have backups of anything in there
Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
In my case, there is not <Context path="/name"....> in server.xml
and unpackWARs="true" . but Still tomcat not unpacking the war. In normal fashion its working fine.
Tomcat version is 4.0.5 JDK 1.5 and OS : solarsi10.
I am doing all the above steps.