2015-04-23 53 views
0

我在CentOS 6.2上运行Tomcat 7.0.23。我有一个WAR,我使用服务器特定的上下文XML文件进行部署。Tomcat7 WAR解压缩不完整

的conf/server.xml中包含:

<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> 

的conf /卡塔利娜/本地主机/ MyWebapp.xml包含:

<Context docBase="/opt/apache-tomcat-7.0.23/MyWebapp.war" unpackWAR="true"> 

WAR文件包含(我的解压验证它它):

css/style.css 
META-INF/MANIFEST.MF 
META-INF/maven/... 
WEB-INF/classes/... (the .class files) 
WEB-INF/lib/... (some .jar files) 
WEB-INF/resources/... 
WEB-INF/web.xml 
WEB-INF/log4j.xml 

当部署在Tomcat中(使用热部署或冷的部署,都与以前删除MyWebapp文件夹)的工作/卡塔利娜/本地主机/ MyWebapp/文件夹中只包含:

WEB-INF/classes/... 
WEB-INF/lib/... 

Tomcat 7 Host Documentation为参数unpackWARs说:

Set to true if you want web applications that are placed in the appBase directory as web application archive (WAR) files to be unpacked into a corresponding disk directory structure, false to run such web applications directly from a WAR file. 

所以它不是什么它实际上解压非常具体。

是否预期Tomcat没有解包整个WAR文件的行为?这是记录在哪里?我应该在哪里放置资源文件?

回答

0

这似乎是Tomcat 7.0.12 - 7.0.47版本中的一个奇怪行为。 的changelog为7.0.12版本包含:

Don't unpack WAR files if they are not located in the Host's appBase. 

并为7.0.48版(发布为7.0.50):

Add support for unpacking WARs located outside of the Host's appBase in to the appBase. 

有关这些更改的更多信息请参阅相应Bugzilla entry