Red Hat Bugzilla – Bug 819112
tomcat doesn't deploy context file properly
Last modified: 2012-05-04 17:44:06 EDT
In the WEB-INF folder of my webapp, which I'll call ABC, there is a context.xml containing a jdbc resource. When tomcat deploys the war file, the context.xml is ignored. Some research on the web suggested that the context should be in a file called ABC.xml in /etc/tomcat/Catalina/localhost and that tomcat should automatically copy it there. I copied my context.xml file to that location as ABC.xml and the jdbc resource works. However, when I deployed a new version of my ABC.war file, the context file in /etc/tomcat/Catalina/localhost was removed and jdbc stopped working again. I tried naming the file in WEB-INF as ABC.xml instead of context.xml and that didn't make any difference. There shouldn't be a permissions problem, since tomcat is able to delete files out of the directory. Am I doing something wrong or is tomcat?
As far as I know context.xml should be placed in META-INF folder. Not in WEB-INF.
Yep, sorry, it was me doing it wrong... Jetty has it's config in the WEB-INF folder, so I wrongly assumed the context.xml would be there too.