• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CATALINA_BASE/conf/Catalina/localhost/<APPNAME>.xml is different from application's context.xml

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been running a web application on Tomcat, when I make some changes in the application, including context.xml, and redeploy it, I start receiving an exception:

After looking around, I realise that the appname.xml in CATALINA_BASE/conf/Catalina/localhost is different than an updated context.xml, so when an application tries to look up a jndi resource, it cannot find any. According to this, 2 files must be exactly the same. I come up with 2 explanations, and questions, for this case:
  • There is an issue that makes appname.xml unchanged during redeployment
  • Although I change context.xml, tomcat still stores an old version somewhere and use it instead of a new one

  • I wonder if there is anyone see those issues before, if there is, I really appreciate any solutions. Or, if you have other explanation and/or question for my case, you're welcome! Thanks

    M

    PS: the tomcat is in my company's server, so I cannot just go and change appname.xml directly
     
    Saloon Keeper
    Posts: 27763
    196
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Sorry about the delay. We were trying to determine whether your display name met our requirements (no "handles", nicknames or aliases).

    Tomcat can obtain (or synthesize) a Context definition from a number of different places. If there are definitions in more than one place, the definitions are not merged. Instead a hierarchy exists to determine which Context will be used. The rules are in the Tomcat documentation.

    An explicit CATALINA_BASE/conf/Catalina/localhost/<APPNAME>.xml will take precedence over the META-INF/context.xml in a WAR (if one exists there). You should note, however, that "APPNAME" (the Context filename) will be the context name used, regardless of what name is coded on the Context element itself.

    And, of course, when you re-deploy a webapp, you need to delete the exploded copy of the old WAR from the Tomcat webapps directory if one exists there, since that copy will be used instead of a newer WAR file.

     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic