JBoss在展开的部署目录上重新部署更改 [英] JBoss redeploy changes on exploded deployment directory

查看:167
本文介绍了JBoss在展开的部署目录上重新部署更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不重新启动JBoss的情况下搜索部署新更改的方法引发了我的注意:



https://community.jboss.org/wiki/RedeployAnApplicationWhenChangeAFileInAnExplodedDeploymentDirectory



起初,我以为我只是发现圣杯,触摸爆炸目录上的顶级描述符将重新部署新的更改,但随后开始出现奇怪的行为和错误。



结果表明servlet和Java课程没有重新部署,在阅读了许多负面答案之后,我放弃了这一点,但至少我想知道,在触摸顶级描述符之后重新部署了什么?



<如果你们需要知道,我正在部署一个Java EE项目作为对JBoss 4x的战争。

解决方案

虽然应用程序真正重新部署了工作默认情况下,目录并没有真正被删除(这是JBoss保存已编译的jsp的地方),因此在重新部署之后它可能会保留以前编译的jsp类。



在JBoss 5.1中(我不是100%肯定它是否可用于JBoss 4.x)有一个选项可以强制JBoss在取消部署时删除应用程序的工作目录 - 重新部署。您可以在以下位置找到此选项:$ JBOSS_HOME / server / yourInstance / deployers / jbossweb.deployer / META-INF / war-deployers-jboss-beans.xml,在此文件中查找属性:

 < property name =deleteWorkDirOnContextDestroy> true< / property> 

默认情况下,它设置为false,因此将其设置为true。也许在重新部署时可能有助于解决您的问题,尽管热部署的成功可能取决于对其他类的依赖性等。另一方面,在热部署或重新部署应用程序时,使用move命令(mv),但从不复制(cp)一,因为mv是原子的而不是cp(使用cp,热文件扫描程序可以在文件仍被复制时激活)。



另一种解决方案热重新部署是手动删除它(建议仅用于开发环境)我们使用以下命令链(请记住,您已经在deploy目录中):

  rm yourapp.war; rm -rf ../work/jboss.web/localhost/yourapp;mv< newappversiondir> /yourapp.war。 

但请记住,生产和关键环境中的热部署非常强烈不鼓励。


Searching for a way to deploy new changes without restarting the JBoss leaded me to this:

https://community.jboss.org/wiki/RedeployAnApplicationWhenChangeAFileInAnExplodedDeploymentDirectory

And at first, I thought I just found the holy grail, touching the top level descriptor on a exploded directory will redeploy the new changes, but then the weird behavior and errors started.

Turns out that servlets and Java classes are not getting redeployed, after reading many negative answers around, I gave up on this, but at least I want to know, whats getting redeployed after touching the top level descriptor?

If you guys need to know, I'm deploying a Java EE project as a war on JBoss 4x.

解决方案

Though the application is really redeployed the work directory isn't really deleted by default (it's where JBoss saves the compiled jsp's), so after a redeploy it may keep the previous compiled jsp classes.

In JBoss 5.1 (I'm not 100% sure if it's available in JBoss 4.x) there is an option to force JBoss deleting the work directory for an application when it's undeployed - redeployed. You can find this option in: $JBOSS_HOME/server/yourInstance/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml, in this file look for the property:

<property name="deleteWorkDirOnContextDestroy">true</property>

By default it's set to false, so set it true. Maybe it may help to solve your problem when redeploying, though the success of hotdeployment may depend on dependencies on other classes, etc. On the other hand when hot deploying or redeploying an application, use the move command (mv), but never the copy (cp) one, since the mv is atomic but not the cp (with cp the hot deployment scanner could be activated while the file is still being copied).

Another solution to hot redeploy is to delete it manually, (recommended just for development environments) we use the following chain of commands (taking in mind you're already in the deploy directory):

rm yourapp.war; rm -rf ../work/jboss.web/localhost/yourapp;mv <newappversiondir>/yourapp.war .

But take in mind that hot deployment in production and critical environments is strongly discouraged.

这篇关于JBoss在展开的部署目录上重新部署更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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