Tomcat 7 热部署配置

当工程修改后使用Eclipse的export功能重新发布到Tomcat 7 的webapps目录下时,

发现Tomcat 7 在解压war包时没法删除原来解压出来的工程导致无法实时发布。

解决办法如下:

现在只要设置一下 context.xml

1.找到 context.xml ,这个文件在 %Tomcat_Home%\conf 下

2.打开文件,在 <Context>标记上添加属性: antiJARLocking="true" antiResourceLocking="true"
3.保存,然后重启Tomcat

修改后的context.xml如下:

<Context antiJARLocking="true" antiResourceLocking="true">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
   
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

</Context>

红色部分为增加的内容

posted @ 2010-08-07 15:57  MikeLin  阅读(6805)  评论(0编辑  收藏  举报