在Tomcat热部署期间如何覆盖war文件? [英] How to overwrite war files during Tomcat hot deployment?

查看:909
本文介绍了在Tomcat热部署期间如何覆盖war文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Tomcat 7.0进行Web应用程序部署...现在仍然习惯于停止服务器并删除旧的war文件并粘贴新的war文件,然后启动服务器...现在我听说了热部署服务并愿意为我的网站进行热部署...我在堆栈溢出中搜索了各种问题,并根据答案进行了尝试,但均无法正常工作..我有一个 adweb.war 战争文件,进行一些更新,并生成相同的 adweb.war 并将其覆盖在WebApps文件夹中...我该怎么做?请用简单的步骤回答,以便我容易理解..请不要将其标记为重复,因为我写了这个问题,因为该主题的答案不够,有些答案对于我这样的初学者来说很难理解.因此,我希望这个问题能对像我这样的初学者有所帮助...

I am using Tomcat 7.0 for my web application deployment ... Still now i used to stop the server and delete the old war file and paste the new war file and then start the server ... Now I heard about hot deployment service and willing to do hot deployment for my website ... I searched various questions in stack overflow and tried according to the answers but its not working .. I have a war file as adweb.war and made some updates and produce the same adweb.war to be overwritten in the WebApps folder ... How can I do that ? Pls answer in simple steps so that I can easily understand .. Pls dont mark this as duplicate because I wrote this question as there is insufficient answers in this topic and some answers are there which are very complicated to understand for beginners like me . So I hope this question will help beginners like me ...

推荐答案

使用Tomcat 7,更轻松地完成更新战争的任务而又不减少Tomcat的工作量.有多种方法可以做到这一点.

With Tomcat 7, the task of updating wars without taking down the tomcat is easier. There are multiple ways to do this.

我建议您遵循以下任一方法:

I would suggest you to follow either one of the below:

  1. 使用Tomcat管理器GUI
  2. 通过Tomcat的Deploy任务使用基于ANT的部署.

在上述任何一种情况下,您都需要将您的war文件从adweb.war重命名为 adweb ##.war和context.xml(如果需要),然后上传到远程/本地tomcat设置.

In any of these cases, you would need to rename your war file, from adweb.war to adweb##.war, and context.xml (if needed) and upload to a remote/local tomcat setup.

每次您需要升级战争时,在重命名战争文件时只需使用比上一个版本更高的版本号即可.

Everytime you need to upgrade your war, just use a higher version number than the previous one while renaming the war file.

请注意,在执行热部署时,上下文路径/adweb也应更新为/adweb ##.

Note that, the context path /adweb should also be updated as /adweb## while performing hot deployment.

一旦成功部署了新版本(在管理器用户界面中指示),您就可以停止/取消部署以前的版本.否则,tomcat仍将使用最新版本,并且所有新请求都将重定向到新版本.

Once, the new version is successfully deployed (indicated in the manager UI), you can stop/undeploy the previous version. If not, the tomcat will still use the latest version and all the new requests will be redirected to the new version.

这篇关于在Tomcat热部署期间如何覆盖war文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆