Is there a way that I can put my context xml file in war file and use the above method to deploy my application so that Tomcat automatically picks up context xml file from the war file?
I didn't know you could deploy the context file; that's neat. But I doubt you can get it into the war file, because that file is simply exploded in the webapps directory, and what's more, its contents are defined in the Servlet specification. The context file, on the other hand, is completely Tomcat-specific. Including it in the war file would negate the benefit of standardized war files.
I hope, I understand you correctly. But couldn't you place the context.xml in the META-INF directory of your WEB application, rebuild your WAR file and then deploy it?
And true, this will only apply to the Tomcat container.
Lakshman Easwaran
Greenhorn
Joined: Jun 27, 2005
Posts: 4
posted
0
Craig and Ulf,
Thanks for your replies.
Even after placing context.xml in META-INF directory, context xml is not deployed correctly after deployment.
Any other ideas?
Thanks, Lakshman
Lakshman Easwaran
Greenhorn
Joined: Jun 27, 2005
Posts: 4
posted
0
Craig was right. One has to put context.xml in META-INF and include that in the war file. After that put the war file in TOMCAT_HOME/webapps and restart Tomcat. This will correctly deploy the context.xml to TOMCAT_HOME/conf/Catalina/<host-name> under the name of web application.
If you use URL method to deploy webapplication, like the one mentioned in my first posting in this topic, context.xml will not be deployed correctly.
Victor Thomson
Greenhorn
Joined: Aug 23, 2005
Posts: 5
posted
0
So does this mean that if you use the catalina-ant deploy task in your build.xml to deploy your war file, and if you have a context.xml file in META-INF, that the application will not deploy correctly? I think it uses the URL method and have been struggling trying to get this to work...