Tomcat无法自动部署war文件 [英] Tomcat not autodeploying war file

查看:1022
本文介绍了Tomcat无法自动部署war文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行了以下步骤


  • 关闭Tomcat

  • 部署带有时间戳的war文件12月1日

  • 启动Tomcat - 这为已部署的war文件创建了展开目录。

  • 停止Tomcat

  • 使用时间戳为12月3日的新文件更新war文件

  • 重新启动Tomcat

  • Shutdown Tomcat
  • Deployed a war file with a timestamp of 1st December
  • Start Tomcat - This created the exploded directory for the deployed war file.
  • Stop Tomcat
  • Updated the war file with a new one with a timestamp of 3rd December
  • Restart Tomcat

我发现当我重新启动Tomcat时,先前展开的文件夹中的现有文件未更新。 war文件的更新是否已更新相关的jsp,类文件?

I found that when i restarted Tomcat, the existing files in the folder that was expanded previously were not updated. Shouldnt the update to the war file have updated the relevant jsp, class file?

我看了一下文档,发现这个 http://tomcat.apache.org/tomcat-5.5-doc/config/host.html 。 自动应用程序部署下的以下引用

I looked at the documentation and found this http://tomcat.apache.org/tomcat-5.5-doc/config/host.html. The following quote under "Automatic Application Deployment"


除了在启动时发生的自动
部署
时间,您还可以请求将新的
XML配置文件,WAR
文件或
子目录放入appBase(或者
$ CATALINA_HOME / conf / [ engine_name] / [host_name]
在XML配置
文件的情况下)目录,而Tomcat是
运行将自动
部署,根据规则
描述以上。自动部署者
还将跟踪
的网络应用程序以下更改:

In addition to the automatic deployment that occurs at startup time, you can also request that new XML configuration files, WAR files, or subdirectories that are dropped in to the appBase (or
$CATALINA_HOME/conf/[engine_name]/[host_name] in the case of an XML configuration file) directory while Tomcat is running will be automatically deployed, according to the rules described above. The auto deployer will also track web applications for the following changes:


  • WEB-INF的更新/web.xml
    文件将触发web
    应用程序的重新加载

  • 已扩展的WAR
    的更新将触发
    取消部署(删除
    扩展的webapp),然后执行
    部署

  • 对XML
    配置文件的更新将触发
    undeploy(没有删除任何
    扩展目录),然后是关联web
    应用程序的
    部署

由于上述第2点,文件是否已自动更新?

Shouldnt the files have been automatically been updated as a result of point 2 above?

在server.xml中将Autodeploy设置为true

Autodeploy is set to true in server.xml

推荐答案

从历史上看,当你刚刚放入一个新罐子时,tomcat从未更新过爆炸目录,至少对我而言。我一直认为这是一个错误,但从未调查过,因为有一个简单的解决方案。这两个都应该可以正常工作:

  • 使用内置管理器应用程序部署war文件。如果您可以使用GUI进行生产管理,那就很好。 注意如果你多次部署这个工具曾经有问题(再次,我从未深入研究过细节),但Tomcat重启工作正常。

  • 停止,删除,删除。停止Tomcat,删除展开的目录,放入新的war文件。
  • Historically, tomcat has never updated the exploded directory when you just drop in a new jar, at least for me. I always assumed this to be a bug, but never looked into it as there is a simple solution. Both of these should work fine:

  • Deploy the war file using the build-in Manager application. Fine if you are ok with using a GUI for production administration. Note This tool used to have issues if you deployed multiple times (again, I never delved into the details), but a Tomcat restart worked fine.
  • Stop, Delete, and Drop. Stop Tomcat, delete the exploded directory, drop in the new war file.
  • 这篇关于Tomcat无法自动部署war文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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