java JBoss 是否缓存类文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1568546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 17:07:33  来源:igfitidea点击:

Does JBoss cache class files?

javajsfcachingjbosspojo

提问by Alex

I'm wrestling with a strange problem: When I make a change to a POJO or Seam Component in my localhost JBoss instance, restart it, and load the page, the change is visible. However, on our server, running the same version of JBoss, when I stop the instance, delete the WAR file, upload the latest version, and restart JBoss, it won't show some of the new server-side functionality.

我遇到了一个奇怪的问题:当我对本地 JBoss 实例中的 POJO 或 Seam 组件进行更改、重新启动它并加载页面时,更改是可见的。但是,在我们的服务器上,运行相同版本的 JBoss,当我停止实例、删除 WAR 文件、上传最新版本并重新启动 JBoss 时,它不会显示一些新的服务器端功能。

Specifically, the change is to a POJO class which implements javax.faces.validator.Validator class. It's then used in the XHTML Facelet like this:

具体来说,更改是对实现 javax.faces.validator.Validator 类的 POJO 类。然后像这样在 XHTML Facelet 中使用它:

<h:inputText value="#{outsideaccount.accountOrganizationEmail}" maxlength="50"
  id="txtOrganizationSupportEmail" 
  validatorMessage="Organization Support Email is not valid. It must be in the pattern 'some_id@some_domain.com'.">
  <f:validator validatorId="AnyEmailValidator"/>
</h:inputText>  

I'm able to use the email validator on my localhost JBoss correctly; on the development server, it throws a validation error using the same email on the same page. Very strange. Is JBoss caching the class files somewhere? How do I clear everything out of the JBoss development server cache?

我可以在我的本地主机 JBoss 上正确使用电子邮件验证器;在开发服务器上,它在同一页面上使用相同的电子邮件引发验证错误。很奇怪。JBoss 是否在某处缓存类文件?如何清除 JBoss 开发服务器缓存中的所有内容?

I'm using Win XP Pro locally; the development server is using JBoss 4.2.3.GA on JVM Version 1.5.0_16-b02, with Unix SunOS 5.10. Thanks.

我在本地使用 Win XP Pro;开发服务器在 JVM 版本 1.5.0_16-b02 上使用 JBoss 4.2.3.GA,带有 Unix SunOS 5.10。谢谢。

回答by Yishai

JBoss has work and tmp directories that you can delete to make sure everything is clean. Things can get cached there, so you can clear them out on deploy if you are having problems. There is also a settingto force that to happen automatically on JBoss's end. If your problem is a cache clearing problem, this will help solve it.

JBoss 有 work 和 tmp 目录,您可以删除它们以确保一切都干净。东西可以缓存在那里,所以如果你有问题,你可以在部署时清除它们。还有一个设置可以强制在 JBoss 端自动发生。如果您的问题是缓存清除问题,这将有助于解决它。

Another possibility is that you have two copies of that war deployed on JBoss, although that should give you some errors when you deploy in production.

另一种可能性是您在 JBoss 上部署了该War的两个副本,尽管在生产中部署时应该会出现一些错误。