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
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, 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,
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."