Launch JBoss Wildfly 10

472 views
Skip to first unread message

ruedige...@googlemail.com

unread,
Apr 14, 2016, 2:37:13 AM4/14/16
to HotswapAgent
Hi!

I'm trying to launch a JBoss Wildfly 10.0.0 with the HotSwapAgent from within IntelliJ IDEA.

I pass `-ea -XXaltjvm=dcevm -javaagent:<path-to>/hotswap-agent.jar` (where `<path-to>` is my real path) as VM options, but I get this stacktrace during startup:

    HOTSWAP AGENT:7:59:21.869INFO(org.hotswap.agent.HotswapAgent)-Loading Hotswap agent{0.3.0-SNAPSHOT}-unlimited runtime class redefinition.
    HOTSWAP AGENT:7:59:22.385INFO(org.hotswap.agent.config.PluginRegistry)-Discovered plugins:[Hotswapper,AnonymousClassPatch,WatchResources,Hibernate,Spring,Jersey2,Jetty,Tomcat,ZK,Logback,JSF,Seam,ELResolver,OsgiEquinox,Proxy,WebObjects,Weld,JBossModules,Resteasy,Gae]
    HOTSWAP AGENT:7:59:22.505ERROR(org.hotswap.agent.annotation.handler.OnClassLoadedHandler)-InvocationTargetException in transform method on plugin'class org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin'class'org/jboss/modules/ModuleClassLoader'.
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.hotswap.agent.annotation.handler.OnClassLoadedHandler.transform(OnClassLoadedHandler.java:157)
    at org.hotswap.agent.annotation.handler.OnClassLoadedHandler$1.transform(OnClassLoadedHandler.java:76)
    at org.hotswap.agent.util.HotswapTransformer.transform(HotswapTransformer.java:129)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
    Caused by:org.hotswap.agent.javassist.CannotCompileException:[source error]setResourceLoaders(java.lang.Object,org.jboss.modules.ResourceLoaderSpec[])not found in org.jboss.modules.ModuleClassLoader
    at org.hotswap.agent.javassist.CtBehavior.setBody(CtBehavior.java:432)
    at org.hotswap.agent.javassist.CtBehavior.setBody(CtBehavior.java:400)
    at org.hotswap.agent.plugin.jbossmodules.ModuleClassLoaderTransformer.patchModuleClassLoader(ModuleClassLoaderTransformer.java:91)
    ...28more
    Caused by:compile error:setResourceLoaders(java.lang.Object,org.jboss.modules.ResourceLoaderSpec[])not found in org.jboss.modules.ModuleClassLoader
    at org.hotswap.agent.javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:684)
    at org.hotswap.agent.javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:651)
    at org.hotswap.agent.javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:147)
    at org.hotswap.agent.javassist.compiler.ast.CallExpr.accept(CallExpr.java:43)
    at org.hotswap.agent.javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:241)
    at org.hotswap.agent.javassist.compiler.CodeGen.atDeclarator(CodeGen.java:725)
    at org.hotswap.agent.javassist.compiler.ast.Declarator.accept(Declarator.java:117)
    at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:352)
    at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:51)
    at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:352)
    at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:51)
    at org.hotswap.agent.javassist.compiler.CodeGen.atMethodBody(CodeGen.java:296)
    at org.hotswap.agent.javassist.compiler.Javac.compileBody(Javac.java:204)
    at org.hotswap.agent.javassist.CtBehavior.setBody(CtBehavior.java:425)
    ...30more

... and then later, when my application is deployed:

    WFLYSRV0153: Failed to process phase POST_MODULE of deployment "dipper.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.jboss.as.weld.deployment.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:99)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.createExplicitBeanDeploymentArchive(BeanArchiveProcessor.java:338)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.processResourceRoot(BeanArchiveProcessor.java:295)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.handleResourceRoot(BeanArchiveProcessor.java:229)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.access$100(BeanArchiveProcessor.java:198)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor.deploy(BeanArchiveProcessor.java:118)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more

... and the deployment fails.

I understand that the JBossModules plugin is available, but it doesn't seem to be able do it's job. Briefly looking at the source of org.jboss.modules.ModuleClassLoader I have the impression this could be an incompatibility with Wildfly 10.

BTW: the JBoss-Module is not in the list of plugins on the HotSwapperAgent website.


Regards
Rüdiger

vladimir dvorak

unread,
Apr 14, 2016, 3:16:50 AM4/14/16
to HotswapAgent
  Hi,

I didn't test it on Wildfly 10.x. It looks there is something new that break the HA functionality.  We should fix it. JBossModule was not in last 0.3 release so that it is still not mentioned in the README.

ruedige...@googlemail.com

unread,
Apr 17, 2016, 4:21:51 AM4/17/16
to HotswapAgent
Hi Vladimir,


vladimir dvorak wrote:
I didn't test it on Wildfly 10.x. It looks there is something new that break the HA functionality.  We should fix it.

 I've created issue 124.

Rüdiger

alp...@gmail.com

unread,
Apr 17, 2016, 2:38:27 PM4/17/16
to HotswapAgent
You might want to try https://github.com/alpapad/HotswapAgent/tree/wildfly10

This is tested and working in wildfly 10.  The changes in this repo is slowly being pushed to  HotswapAgent master but they are not all there.


If you are using maven/eclipse, then this configuration has worked for me:

In you pom(s) add:

<build>
....
<resources>
            <resource>
                <directory>${basedir}/src/main/resources/</directory>
                <includes>
                    <include>**/hotswap-agent.properties</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources/</directory>
                <excludes>
                    <exclude>**/hotswap-agent.properties</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
</resources>
....
</build>

And then have the file hotswap-agent.properties in src/main/resources. Mine looks like this:
----
# web fragment or jar
extraClasspath=${project.build.outputDirectory}
autoHotswap=true
#LOGGER=debug

---
# war
extraClasspath=${project.build.outputDirectory}
watchResources=${project.basedir}/src/main/webapp
autoHotswap=true
#LOGGER=debug



--

For standalone I use the following opts (linux):
JAVA_OPTS="-XXaltjvm=dcevm -javaagent:/home/path-to-hotswap-agent/hotswap-agent.jar -Xverify:none -noverify"

(the no verify just makes classloading faster, not for production use)

Regards,
Alex

vladimir dvorak

unread,
Apr 20, 2016, 2:50:38 PM4/20/16
to HotswapAgent
Hi, I've fixed it. Tested with Wildfly 9/10

Майдарын Бямбасүрэн

unread,
Jul 9, 2016, 6:20:24 PM7/9/16
to HotswapAgent
Dear Vladimir dvorak,

I have that problem too. please shar me jar for wildfly 10 !

vladimir dvorak

unread,
Jul 11, 2016, 2:50:48 AM7/11/16
to HotswapAgent
Did you try the repo version?
Reply all
Reply to author
Forward
0 new messages