War 文件在部署到 webapps 文件夹后不会爆炸。
我们使用的是 tomcat 7,下面是我遵循的过程。
- 停止tomcat服务
- 部署war文件
- 启动tomcat服务
我已经将 auto deploy 和 unpackwars 设置为“True”
下面是 server.xml 文件:
<Host name="x.x.x.x" appBase="/var/lib/dweb13s2/webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
最佳答案
查看文档 RemoveUnpackWARs .可能你还没有去掉之前的目录结构。
If unpackWARs=true and a WAR is updated while Tomcat is stopped, Tomcat will not realise that the unpacked directory structure is from an older version of the WAR and will continue to use it.
关于java - war 文件没有爆炸的原因可能是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38013601/