• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deployment of Web Application

 
Lakshman Easwaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I deploy an application in Tomcat thats runs on remote server from a local path as below:

http://<host-name>/manager/deploy?path=/<web-app-name>&config=file:<absolute-path-to-context-xml-file>&war=jar:file:<absolute-path-war-file>!/

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?

ie., just by using this

http://<host-name>/manager/deploy?path=/<web-app-name>&war=jar:file:<absolute-path-war-file>!/

Let me know if I am not making my question clear.

Thanks,
Lakshman
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

Thanks

-Vic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic