aspose file tools*
The moose likes Tomcat and the fly likes .WAR not unpacking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark ".WAR not unpacking" Watch ".WAR not unpacking" New topic
Author

.WAR not unpacking

Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
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


UP THE IRONS !
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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 ]
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
Hi Bill,
1. Yes, unpackWARS is set to TRUE.
2. I dont have the Prep directory in there.
3. I DO have the WEB-INF dir and web.xml file in the WAR,
So, I am not sure what is going on...
-Sri
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
That is a mystery alright - which version of Tomcat are we talking about? Also which operating system and SDK version?
Bill
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
The tomcat version is 4.1.24
The JDK is 1.4.
-Sri
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
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
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
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.
Mohammed Majeed
Greenhorn

Joined: Feb 18, 2010
Posts: 1
Hi All
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.

thanks
tripleM
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .WAR not unpacking