This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes WAR files with Tomcat 4.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "WAR files with Tomcat 4.1" Watch "WAR files with Tomcat 4.1" New topic

WAR files with Tomcat 4.1

Michael Mendelson
Ranch Hand

Joined: Dec 19, 2000
Posts: 73
Strangely, I can't get tomcat 4.1 to unpack my WAR files! The war file deploys in tomcat 4.0, and was constructed using ant.

The server.xml file has no context explicitly set up for this war, and has the following configuation (I think this is out of the box):

The log file shows the following:

...BUT... When I look at the jar the MANIFEST.MF file seems to be there:

Any ideas, anyone? Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17161

I think I got the identical situation under an earlier Tomcat - maybe even a 3.x one. I'm not yet able to run Tomcat 4.1 because my EJB server currently only work up to 4.06, so it's not exclusively an Tomcat 4.1 problem.
Unfortunately, I don't remember how I fixed it. You MIGHT be able fix it by manually purging any previous unpacked WAR (delete the unpacked directories in $TOMCAT_HOME/webapps AND in "$TOMCAT_HOME/work/localhost/".
If that doesn't make it happy, what I'd do is ZIP/tar the existing tomcat directory in its entirety and remove the original (e.g. "-m" option on ZIP) so that you can retrieve config files as needed, then re-install Tomcat4 from scratch.
Wish I could be more specific, but I DO know that Tomcat doesn't bother to purge certain things that it would be safer if it did, such as stale webapp files.
Good luck!

An IDE is no substitute for an Intelligent Developer.
Jason Vogel

Joined: Dec 24, 2002
Posts: 3
I can't promise this is the answer, but I just installed Tomcat 4.1.18 last night. I was trying to play with Struts, and I couldn't get it to unpack my WAR files. I had them in a directory "struts" under "webapps". I read one post that could be your issue and then how I solved my issue. The post said something like "that TC won't unpack a WAR file if there is already a directory of the same name there..." Sounds a little funny, but it made me question my directory structure. Once I moved my WAR files up a directory, then TC immediately, automatically unpacked them.
Just an idea,
Michael Mendelson
Ranch Hand

Joined: Dec 19, 2000
Posts: 73
Hey guys, thanks for your responses! It was a permissions issue.
Here's my confession - I know a lot about java but have done much of my development on Windoze boxes. I'm still working out permissions issues on these Linux machines. More often than not, that's the cause of my concerns.
When the RPM created the directories, for some reason it didn't give group write permissions to the webapps directory! Perhaps I shouldn't have run the install as root!
Anyway, I fixed it with

...and that did it!
I agree. Here's the link:
subject: WAR files with Tomcat 4.1
jQuery in Action, 3rd edition