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.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

.WAR not unpacking

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic