Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7625697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:13:33+00:00 2026-05-31T05:13:33+00:00

Tomcat documentation (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html) Only if a context file does not exist for the application

  • 0

Tomcat documentation (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html)

Only if a context file does not exist for the application in the
$CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at
/META-INF/context.xml inside the application files. If the web
application is packaged as a WAR then /META-INF/context.xml will be
copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to
match the application’s context path. Once this file exists, it will
not be replaced if a new WAR with a newer /META-INF/context.xml is
placed in the host’s appBase.

Text in bold is clear. But I notify as not true. (I need exactly this behaviour)

Here are steps:

  1. aaa.war with context.xml included into META-INF
  2. copy to webapps. tomcat deploys. File conf\Catalina\localhost\aaa.xml OK
  3. change aaa.war by changing META-INF/context.xml
  4. copy to webapps
  5. File conf\Catalina\localhost\aaa.xml is changed!!!

What is wrong? Is it a bug or a hidden feature?

Background – the issue I want to resolve:

Configuration independent build and installation. I plant to ship war file. Client per-configures his Tomcat using his own settings. when I ship a new release I just delivery the war without config and when deployed it will use client specific configuration.

By documentation the best place is the context.xml But if it overwritten each time it make no sense to use at all. (why would I use JNDI and such a things if new deliverable has to created? Changing something in build-time is not a big configuration advantage.)

Environment: windows, tomcat 6.0.33

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:13:34+00:00Added an answer on May 31, 2026 at 5:13 am

    I’ve run into the same problem and the documentation is at least inadequate, if not directly misleading.

    The problem is, that if you copy a new version of an already deployed WAR file to the webapps directory, Tomcat will not redeploy the existing application but undeploy the old application and then deploy the new application. The difference may first seem insignificant, but the problem is that during undeployment of the old application, any context files in conf/Catalina/localhost are deleted as well. Then, the new context file from the current WAR file will be copied to conf/Catalina/localhost during deployment of the new application.

    The only feasible solution I’ve found is not to deploy the new application as a WAR file, but to replace or overwrite the expanded directory, e.g. not to copy aaa.war to webapps/ but to unpack aaa.war directly into webapps/aaa/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tomcat documentation says: The locations for Context Descriptors are; $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml $CATALINA_HOME/webapps/[webappname]/META-INF/context.xml On my server,
I was trying to follow this example http://www.mulesoft.org/documentation/display/MULE3USER/Building+Web+Services+with+CXF on a legacy project so then
Reading through the documentation on Apache Tomcat, when I deploy a webapp it copies
Here we have a link http://www.playframework.org/documentation/1.0.1/ide about how to configure playframework to be working
I'm interested in using Apache's JAX-RS implementation (CXF) in a Tomcat environment. The documentation
I am trying to reload a Tomcat6 web application (for example the Tomcat Documentation)
Tomcat docs says that Normally, application classes should NOT be placed here: $CATALINA_BASE/lib .
I've tried to implement the 'Layout with Dijit' tutorial http://dojotoolkit.org/documentation/tutorials/1.7/dijit_layout/ as a JSP. My
As siren documentation explains, the file located in tomcat/conf/Catalina/localhost must set the path of
Does Tomcat sandbox apps, like running them on a separate JVM or of some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.