wood burning stoves 2.0*
The moose likes Tomcat and the fly likes UnpackWAR 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 "UnpackWAR" Watch "UnpackWAR" New topic
Author

UnpackWAR

Scott Burnett
Greenhorn

Joined: Feb 17, 2004
Posts: 3
Hi, I'm pretty sure there is a simple answer to this but I've exhausted every possibility I can think of apart from 'manual'

Situation
I have a domain - www.mydomain.com

I want to base my webapp - /dir/dir/webapps/MyWebApp

at that domain so I created a new host in the Tomcats server.xml

<Host name="www.mydomain.com" unpackWARs="true" appBase="/dir/dir/webapps/MyWebApp">
<Context path=""
docBase="."
</Context>
</Host>

It works - apart from of course I upload my MyWebApp.war to the /dir/dir/webapps/ directory - which does not get picked up by the auto unpack.

I can create an extra dummy host pointing at /dir/dir/webapps/ as the appBase which does the unpack but then 2 instances of MyWebApp are launched and I get a thread nightmare.

I tried moving the MyWebApp.war to /dir/dir/webapps/MyWebApp/ that unpacks but then of course I have my app running in /dir/dir/webapps/MyWebApp/MyWebApp/ ?!

I tried manipulating the docbase in the context.

All to no avail - so now I just manually unpack the war each time I change anything.

Is there a simple answer for a frustrated tomcat newb ?

Cheers
Scott
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Is that instance of Tomcat serving other hosts besides yours?
If not, there was no need to create a new Host entry.

If you want your app to be the root app, replace the tomcat/webpps/ROOT directory with your own.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnpackWAR
 
Similar Threads
New Context problem - Tomcat 4.1.12
Configuring webapp to use subdirectories
Delare virtual host
Can�t load html from Tomcat
Tomcat 4.0.2 unpacking wars