Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.WAR not unpacking

 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tomcat version is 4.1.24
The JDK is 1.4.
-Sri
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mohammed Majeed
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic