my dog learned polymorphism*
The moose likes Tomcat and the fly likes Tomcat 4.0.2 unpacking wars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 4.0.2 unpacking wars" Watch "Tomcat 4.0.2 unpacking wars" New topic
Author

Tomcat 4.0.2 unpacking wars

Jason Brawner
Ranch Hand

Joined: Dec 19, 2001
Posts: 66
I've upgraded from Tomcat 3 to Tomcat 4.0.2 and have lost the ability to
unpack wars. Here is a piece of my server.xml
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
<Context path="/PSP" docBase="PSP" debug="0" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="PspContext." suffix=".txt"
timestamp="true"/>
</Context>
I use the following command to create my war file from within the PSP
directory
jar cfv PSP.war .
This worked great with Tomcat 3(something) but I get the following error
when tomcat 4 starts:
2002-03-04 10:17:09 StandardContext[/PSP]: Error initializing resources:
Document base C:\Tomcat402\webapps\PSP does not exist or is not a readable
directory
2002-03-04 10:17:09 StandardContext[/PSP]: Context startup failed due to
previous errors
2002-03-04 10:17:09 StandardContext[/PSP]:
It is correct that the PSP directory doesn't exist but shouldn't tomcat
create that directory when unpacking the war (which it doesn't do). Any
ideas on how to solve this problem?
Thanks in advance,


Jason E. Brawner<br />Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

If you're on *nix, are there permission difficulties?
Jason Brawner
Ranch Hand

Joined: Dec 19, 2001
Posts: 66
I'm running Win2000pro.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Hm. That's interesting. I've duplicated your problem.

If there is a Context entry for your webapp in server.xml, then Tomcat seems completely unable to unpack the WAR. Remove the Context entry - no problem. But since you want to use a custom logger, it seems with Tomcat 4.x, you need to unpack that WAR yourself.

Have you checked the tomcat-users mail list for this issue? I used to subscribe, but getting several hundred emails a week was getting to be a bit much.

I've just now searched through my Outlook (lookout?) archive of that user list... this seems to be a known (but ignored?) problem in both TC 401 and 402. Someone claims it was fixed in (their words) "TC 402b2". This someone is a user, and not a Tomcat team-member. Perhaps just check out the latest and greatest version from their CVS (haha... wait for it!) and try building it. Yah, I thought that would sound funny.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Hmm...

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4829

Looks like if Remy has anything to do with it, this 'bug' (I'm sure they think of it as a feature) will remain.

His final word seems a bit arrogant to me.

Just saw this other one, which is a pretty succinct summary of the above bug.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2914
[ March 06, 2002: Message edited by: Mike Curwen ]
Jason Brawner
Ranch Hand

Joined: Dec 19, 2001
Posts: 66
Mike, thanks for the reply.
I've asked this question to the tomcat-user group with no reply. However, I was unaware that it would work if I removed the context entry. I can do without the logger!
Thanks,
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I'm somewhat upset by the "tough, deal with it" attitude. It's more like Microsoft to make a feature disappear, and claim it was never proper behaviour.

I have thought of this for some time, and I can't see a reason why the behaviour of dynamically unpacking a WAR file, where an existing Context exists, is a bad thing. In fact, it's the opposite in my mind. Why wouldn't someone want this behaviour?

However, in the tradition of software vendors everywhere, I'll answer my own question. "If you want that feature, you're free to implement it yourself. It's open source."

nice.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Tomcat 4.0.2 unpacking wars
 
Similar Threads
Tomcat War
Tomcat Connection Pool Configuration Problem (Cannot Establish the Connection)
unable to extract war file after restart of tomcat
WAR files with Tomcat 4.1
Context Configuration File - auto-expand WAR