在一个jboss中可以发布多个项目,如果修改一个项目后只想重启该项目,其它项目不重启,可以使用jboss的热部署。
1、修改jboss的配置文件server/default/deploy/jboss-web.deployer/context.xml
在Context元素中添加antiResourceLocking="true" 和 antiJARLocking="true" 属性,如下
<Context cookies="true" crossContext="true" antiResourceLocking="true" antiJARLocking="true" >
<Manager pathname=""/>
<InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
</Context>
2、重启Jboss
3、修改项目下的web.xml(在web.xml中增加或者删除空行就可以),jboss就会只对该项目重新部署。
本文介绍了如何在JBoss服务器上实现单个项目热部署,避免因修改项目而重启全部服务。通过修改jboss-web.deployer/context.xml,设置antiResourceLocking和antiJARLocking属性为true,然后重启Jboss,最后改动web.xml,即可实现目标项目的热部署,而不会影响其他运行中的应用。
722

被折叠的 条评论
为什么被折叠?



