有人在生产中使用过带有 DCEVM 和 HotSwap 代理的 JBoss AS 7.1 吗?哪里有教程吗?是否可以通过 HotSwap 代理添加新的包/类,或者只是替换现有的包/类?
很抱歉这个问题太模糊了。我只是在研究提议的技术。
另一点:我是否必须始终部署为分解的 .war,并在其中替换/添加 .class 文件? 或者我可以部署为压缩的 .war 并复制其他压缩的 .jar 吗?
我的架构是,我有一个 servlet,然后需要从它访问其他组件。我想在运行时添加/替换这些组件。
最佳答案
目前这是不可能的,有一个悬而未决的问题 Jboss support #27 :
JBoss 7 use OSGI classloading and hence agent core classes are not available from application classloader (this is not the case with standard classloaders with parent delegation).
The solution would be to add
-Djboss.modules.system.pkgs=org.hotswap.agent
to older agent versions (similar to https://issues.jboss.org/browse/WFLY-895).However Hotswap agent now sets all necessary properties for JBoss on startup.
还有这个:
Currently, JBoss 7 starts correctly, but ignores configuration properties (extraClasspath, watchResources, webappDir). Hotswap via debugging is still available, but you are unable to use alternative source base.
OSGI classloading must be
"hacked"
to allow all properties. See Jetty/Tomcat plugin for similar implementation.
关于java - 带有 HotSwap 代理的 JBoss,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26775619/