aspose file tools*
The moose likes Tomcat and the fly likes Deployment of Web Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Deployment of Web Application" Watch "Deployment of Web Application" New topic
Author

Deployment of Web Application

Lakshman Easwaran
Greenhorn

Joined: Jun 27, 2005
Posts: 4
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
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
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.


Ping & DNS - my free Android networking tools app
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
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
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
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deployment of Web Application