This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webapps and Context Path

 
Ram Mehta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65113
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic