New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jboss support #27
Comments
… to agent packages. Because it is not possible to exclude subpackages, it was not possible to add whole org.hotswap.agent and hence PluginManager and PluginRespository had to be moved to config subpackage.
… to agent packages. Because it is not possible to exclude subpackages, it was not possible to add whole org.hotswap.agent and hence PluginManager and PluginRespository had to be moved to config subpackage.
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. |
I was able to define module with resource-root under jboss AS7 (6.3). Classloader can load things through ResourceAsStream from there. As so, currently loaded classes are hotswapped, PluginManager is generating these log messages: Reloading classes {} (autoHotswap). It happens only for currently loaded classes, but new classes are not beinged initiated, because ClassLoaderHelper#isClassLoaded does not find the new class, and in turn HotswapperPlugin#watchReload just returns at the first if statement. I also suspect that jboss classloading should be hacked to include the right paths. Btw, jboss ModuleClassLoader does not extend upon URLClassLoader (thats why Tomcat plugin does not work). ModuleClassLoader extends ConcurrentClassLoader, in turn java.lang.ClassLoader (whereas URLClassLoader would extend SecureClassLoader and in turn java.lang.ClassLoader). Thats why ClassLoader is missing ucp field which URLClassLoader has. Any idea where and how to hack the Jboss classloader ? edudant, even jboss starts correctly, it also does not allow adding new classes. Maybe because whole application is redeployed to a temporary folder which jboss defines ar virtual VFS folder and real paths needs to be read or because of something else completely. |
There is a new jboss-modules plugin in the repository. It should solve this issue, could you test it please? |
When trying to use with Jboss eap 6.1.0:
17:10:52,604 ERROR [stderr](MSC service thread 1-7) Reported exception:
17:10:52,604 ERROR [stderr](MSC service thread 1-7) java.lang.NoClassDefFoundError: org/hotswap/agent/PluginManager
17:10:52,604 ERROR [stderr](MSC service thread 1-7) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:72)
17:10:52,604 ERROR [stderr](MSC service thread 1-7) at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
17:10:52,604 ERROR [stderr](MSC service thread 1-7) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
17:10:52,604 ERROR [stderr](MSC service thread 1-7) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
17:10:52,604 ERROR [stderr](MSC service thread 1-7) at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:54)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at cz.csas.knproxy.localservices.heartbeatservice.v01.HeartbeatServiceImpl.(HeartbeatServiceImpl.java:28)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at java.lang.Class.forName0(Native Method)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at java.lang.Class.forName(Class.java:270)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:94)
17:10:52,605 ERROR [stderr](MSC service thread 1-7) at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:145)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.as.ee.component.ViewDescription$DefaultConfigurator.configure(ViewDescription.java:193)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:929)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
17:10:52,606 ERROR [stderr](MSC service thread 1-7) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
17:10:52,607 ERROR [stderr](MSC service thread 1-7) at java.lang.Thread.run(Thread.java:744)
17:10:52,607 ERROR [stderr](MSC service thread 1-7) Caused by: java.lang.ClassNotFoundException: org.hotswap.agent.PluginManager from [Module "deployment.knproxy-ear-1.0.0-SNAPSHOT.ear.knproxy-war.war:main" from Service Module Loader]
17:10:52,607 ERROR [stderr](MSC service thread 1-7) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196)
17:10:52,607 ERROR [stderr](MSC service thread 1-7) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444)
17:10:52,607 ERROR [stderr](MSC service thread 1-7) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432)
17:10:52,608 ERROR [stderr](MSC service thread 1-7) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374)
17:10:52,608 ERROR [stderr](MSC service thread 1-7) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119)
17:10:52,608 ERROR [stderr](MSC service thread 1-7) ... 25 more
The text was updated successfully, but these errors were encountered: