File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Context Configuration File - auto-expand WAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Context Configuration File - auto-expand WAR" Watch "Context Configuration File - auto-expand WAR" New topic
Author

Context Configuration File - auto-expand WAR

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Is there something to specify in a context configuration file that would instruct Tomcat to expand a WAR?
At the moment, I'm using the following context configuration file. With it, Tomcat 4.1.x doesn't expand the WAR, but the web app does run successfully. (Of course, a few things do end up in the work directory.)


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
In server.xml we find:
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
The host tag in my server.xml file looks the same.
However, when I install and start a WAR, with the above context configuration file, using the manager app, the WAR is not expanded.
This may just be some buggy behavior of Tomcat 4.1.27. I can repeat it on four different machines.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Sounds like the unpack rule is only applied when Tomcat is starting up and searching for new WAR files. What happens when you restart Tomcat?
Bill
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
If I (re)start Tomcat with the context configuration file in place, then the WAR is not expanded. If I simply remove the context configuration file, then the WAR is expanded (when restarting, or if the WAR alone is simply added to the webapp folder while Tomcat is already running). That's why I was thinking that maybe I should be adding something to the context configuration file to get the WAR to expand.
I'd simply go without the context configuration file, but then I can't use my Ant script to install/uninstall/start/stop/restart the web app through the manager app, which seems to require the context configuration file.
[ May 09, 2004: Message edited by: Dirk Schreckmann ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Context Configuration File - auto-expand WAR