aspose file tools*
The moose likes Tomcat and the fly likes Webapps and Context Path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Webapps and Context Path" Watch "Webapps and Context Path" New topic
Author

Webapps and Context Path

Ram Mehta
Greenhorn

Joined: Nov 02, 2012
Posts: 1
I have 2 application deployed in one server ( Tomcat 7.0.28 ) and we have also update the context path in server.xml as below

We have noticed sometime the context path directories ( XX and YY ) are creating in webapps directory when the server gets rebooted. So the webapps has below folders.

app1.war app1 app2.war app2 XX YY

We have builded are more than 10 servers and only couple of servers have this issue.

Any thoughts ?

-M
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

What's the issue? The wars are being unpacked into a folder structure. This is the normal default behavior.

There is a setting (not sure which off the top of my head) to have Tomcat simply run the app out of the war without "exploding" it, if that's what you want. Look through the Tomcat docs for configuration and you should find it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

You should NOT put your context definitions in the server.xml file. That behaviour has been discouraged since Tomcat4 first came out. Put each context definition in its own file with an ".xml" suffix and place the files in the TOMCAT_HOME/conf/Catalina/localhost directory. Note that the context name that the app will be deployed under will be taken from the context filename (minus the ".xml" part, and not from the name in the Context element itself

The option for keep WARs from being exploded is "unpackWAR". http://tomcat.apache.org/tomcat-6.0-doc/config/context.html


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webapps and Context Path
 
Similar Threads
Redirecting context paths in Tomcat 5.5
How to deploy different war on different port?
War file deployment in Linux machine not working
Can we define same war with two different context-root?
Problem with referencing session information from 2 contexts, one a subfolder of another