by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Vladimir Dvorak
    @skybber
    Are you sure that the new class is deployed to wildfly? Otherwise if you're deploying via wars it could not work
    gkna
    @gkna
    No, i am not copying the new class to wildfly. I was in an assumption new class will be moved to wildfly after compilation.
    gkna
    @gkna
    I have configured extraClasspath in hotswap-agent.properties file. This path is not getting registered and not seen any error also in the log. Other options like LOGGER=DEBUG has taken.
    gjevardat
    @gjevardat
    Hello
    I have strange behavior with the agent. I have SpringBoot + Vaadin + tomcat setup.
    For my test I have a simple thread that output string in a console.
    When I change the value of the output string, I have to reload the page to have the updated srting , but the previous string is still outputed. Actually I can see that 2 Threads are now present like if the hotswap agent did a duplication of the updated code.
    Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    while(true) {
                        try {
                            System.err.println("within the loop 7");
                            Thread.sleep(2000);
                            if(grid.isAttached() && grid.isVisible() ) {
    
                                updateLastActiveRuns();
                            }
                        } catch (InterruptedException e1) {
    
                        }
                    }
                }
            });
            t.start();
    So basically each time I update the output string, I have a new version of the code that is spawned, concurrently to previous versions
    gjevardat
    @gjevardat
    It looks like the current session is tied to the running version of the code, and only a new session will trigger the loading of new code
    When I save updated java code I see
    HOTSWAP AGENT: 16:47:26.300 RELOAD (org.hotswap.agent.plugin.jvm.AnonymousClassPatchPlugin)
    gjevardat
    @gjevardat
    Interestingly I see in the thread stack ok the JVM :
    Daemon Thread [Thread-18] (Suspended)
    Thread.sleep(long) line: not available [native method]
    <obsolete method in<unknown declaring type>>
    Thread.run() line: 748 [local variables unavailable]
    gjevardat
    @gjevardat
    Maybe as the code never exit this run() method, the obsolete method remains forever in the JVM
    Vladimir Dvorak
    @skybber
    You got it ! Its not possible to hotswap active method !
    gjevardat
    @gjevardat
    Thanks, it seems obvious once you know it :)
    gkna
    @gkna
    I have integrated OpenJDK Hotswap and pointed wildfly JAVA_HOME to this. My eclipse IDE has connected to wildfly using remote debug. I have modified java file but change are not reflecting in the server. Any idea what is wrong here? I am struck with this issue. Any help will be appreciated.
    Vladimir Dvorak
    @skybber
    is the modified .class file deployed to server? Are you following http://hotswapagent.org/mydoc_setup_intellij_idea.html ?
    vdvornyk
    @vdvornyk
    Hi, all!
    I wondering if anyone have successfully applied HotswapProject to WebSphere ?
    Graziano Felline
    @ogipogi

    Hi all!
    I have problems to have a working DCEVM + HotwapAgent on JBOSS EAP 7.2 Docker Container setup.

    Chosen setup:

    • Gradle multi project
    • Definedhotswap-agent.properties with extraClasspathto build/classes (via docker mount) on subprojects src/main/resources.

    I managed to launch the container only with disabling JBossModules plugin.

    HotSwap Agent doesn't recognise changes during remote debug hot swapping.

    If i enable JBossModules plugin i get this error during app server start:

    HOTSWAP AGENT: 08:55:11.139 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.4.1} - unlimited runtime class redefinition.
    HOTSWAP AGENT: 08:55:11.957 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [JdkPlugin, Hotswapper, WatchResources, ClassInitPlugin, AnonymousClassPatch, Proxy, WebObjects, Weld, JBossModules, Undertow]
    Listening for transport dt_socket at address: 8787
    Exception in thread "main" java.lang.NoClassDefFoundError: org/hotswap/agent/util/classloader/HotswapAgentClassLoaderExt
        at org.jboss.modules.Module.<init>(Module.java:247)
        at org.jboss.modules.ModuleLoader$3.run(ModuleLoader.java:729)
        at org.jboss.modules.ModuleLoader$3.run(ModuleLoader.java:724)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.modules.ModuleLoader.defineModule(ModuleLoader.java:724)
        at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:531)
        at org.jboss.modules.DelegatingModuleLoader.preloadModule(DelegatingModuleLoader.java:57)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:295)
        at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:92)
        at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:86)
        at __redirected.__DocumentBuilderFactory.changeDefaultFactory(__DocumentBuilderFactory.java:53)
        at __redirected.__JAXPRedirected.changeAll(__JAXPRedirected.java:53)
        at org.jboss.modules.Main.main(Main.java:428)

    Any idea what is wrong here? I am struck with this issue. Any help will be appreciated.

    Vladimir Dvorak
    @skybber
    Did you follow instruction from https://github.com/HotswapProjects/hotswap-docklands ?
    As I remember there is problem at windows with watching file changes at directory outside docker container, if you have linux, you should not have problem with it
    Graziano Felline
    @ogipogi
    Thank you Vladimir,
    i will now check the instructions from https://github.com/HotswapProjects/hotswap-docklands.
    I want run this setup on OSX, do you know if this setup works there?
    Vladimir Dvorak
    @skybber
    OSX should be OK
    btw, did you try last dcevm :) ?
    Graziano Felline
    @ogipogi
    yes
    Graziano Felline
    @ogipogi

    hmm, i check the config and it looks like my config i have.

    It looks like the hotswap-agent.propertiesfile is not recognized.

    Do you know if i need the JBossModules plugin for EAP 7.2?

    Vladimir Dvorak
    @skybber
    Vladimir Dvorak
    @skybber
    jbossmodules plugin was not updated for a long time, I tried to fix it in new https://github.com/HotswapProjects/HotswapAgent/releases/tag/1.4.2-SNAPSHOT
    Could you check it please for EAP 7.2?
    Graziano Felline
    @ogipogi
    Thank you very much for your help.
    I get still an exception, but an other one:
    Formatter ##CONSOLE-FORMATTER## is not defined
    HOTSWAP AGENT: 10:28:58.522 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.4.2-SNAPSHOT} - unlimited runtime class redefinition.
    HOTSWAP AGENT: 10:28:59.333 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, JdkPlugin, Proxy, WebObjects, Weld, JBossModules, Undertow]
    Listening for transport dt_socket at address: 8787
    HOTSWAP AGENT: 10:28:59.481 ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' class 'org/jboss/modules/ModuleLoader'.
    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.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:218)
        at org.hotswap.agent.annotation.handler.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:112)
        at org.hotswap.agent.util.HotswapTransformer.transform(HotswapTransformer.java:246)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at org.jboss.modules.DefaultBootModuleLoaderHolder$1.run(DefaultBootModuleLoaderHolder.java:35)
        at org.jboss.modules.DefaultBootModuleLoaderHolder$1.run(DefaultBootModuleLoaderHolder.java:33)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.modules.DefaultBootModuleLoaderHolder.<clinit>(DefaultBootModuleLoaderHolder.java:33)
        at org.jboss.modules.Main.main(Main.java:391)
    Caused by: org.hotswap.agent.javassist.CannotCompileException: [source error] getClassLoaderPrivate() not found in java.lang.String
        at org.hotswap.agent.javassist.CtBehavior.insertBefore(CtBehavior.java:806)
        at org.hotswap.agent.javassist.CtBehavior.insertBefore(CtBehavior.java:766)
        at org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin.transformModule(JBossModulesPlugin.java:68)
        ... 14 more
    Caused by: compile error: getClassLoaderPrivate() not found in java.lang.String
        at org.hotswap.agent.javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:777)
        at org.hotswap.agent.javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:723)
        at org.hotswap.agent.javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:170)
        at org.hotswap.agent.javassist.compiler.ast.CallExpr.accept(CallExpr.java:49)
        at org.hotswap.agent.javassist.compiler.JvstTypeChecker.atMethodArgs(JvstTypeChecker.java:235)
        at org.hotswap.agent.javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:763)
        at org.hotswap.agent.javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:723)
        at org.hotswap.agent.javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:170)
        at org.hotswap.agent.javassist.compiler.ast.CallExpr.accept(CallExpr.java:49)
        at org.hotswap.agent.javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:266)
        at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:360)
        at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:53)
        at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:381)
        at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:53)
        at org.hotswap.agent.javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:428)
        at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:385)
        at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:53)
        at org.hotswap.agent.javassist.compiler.Javac.compileStmnt(Javac.java:578)
        at org.hotswap.agent.javassist.CtBehavior.insertBefore(CtBehavior.java:786)
        ... 16 more
    
    Exception in thread "main" java.lang.NoClassDefFoundEr
    Graziano Felline
    @ogipogi
    After applying the fix i get again the originally `NoClassDefFoundError``
    Formatter ##CONSOLE-FORMATTER## is not defined
    HOTSWAP AGENT: 12:56:49.703 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.4.2-SNAPSHOT} - unlimited runtime class redefinition.
    HOTSWAP AGENT: 12:56:50.527 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, JdkPlugin, Proxy, WebObjects, Weld, JBossModules, Undertow]
    Listening for transport dt_socket at address: 8787
    Exception in thread "main" java.lang.NoClassDefFoundError: org/hotswap/agent/util/classloader/HotswapAgentClassLoaderExt
        at org.jboss.modules.Module.<init>(Module.java:247)
        at org.jboss.modules.ModuleLoader$3.run(ModuleLoader.java:729)
        at org.jboss.modules.ModuleLoader$3.run(ModuleLoader.java:724)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.modules.ModuleLoader.defineModule(ModuleLoader.java:724)
        at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:531)
        at org.jboss.modules.DelegatingModuleLoader.preloadModule(DelegatingModuleLoader.java:57)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:295)
        at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:92)
        at __redirected.__RedirectedUtils.loadProvider(__RedirectedUtils.java:86)
        at __redirected.__DocumentBuilderFactory.changeDefaultFactory(__DocumentBuilderFactory.java:53)
        at __redirected.__JAXPRedirected.changeAll(__JAXPRedirected.java:53)
        at org.jboss.modules.Main.main(Main.java:428)
    Graziano Felline
    @ogipogi

    I managed to avoid the NoClassDefFoundError with adding
    -Xbootclasspath/p:$JBOSS_HOME/hotswap-agent/hotswap-agent-1.4.2-SNAPSHOT.jar \to JAVA_OPTS

    I get now new Exception during deploy of activemq-rar and Camunda Engine that i need to investigate first.

    13:29:58,467 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-2) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
    13:30:00,040 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.module.service."deployment.activemq-rar.rar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.activemq-rar.rar".main: Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
        at org.hotswap.agent.config.PluginRegistry.getPluginClass(PluginRegistry.java:293)
        at org.hotswap.agent.config.PluginRegistry.initializePlugin(PluginRegistry.java:165)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:300)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:283)
        at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:66)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        ... 6 more
    
    13:30:00,134 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.module.service."deployment.camunda-webapp-ee-jboss-7.11.11-ee.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.camunda-webapp-ee-jboss-7.11.11-ee.war".main: Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
        at org.hotswap.agent.config.PluginRegistry.getPluginClass(PluginRegistry.java:293)
        at org.hotswap.agent.config.PluginRegistry.initializePlugin(PluginRegistry.java:165)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:300)
        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:283)
        at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:66)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        ... 6 more

    The JBossModules plugin is now loaded:

    HOTSWAP AGENT: 13:29:53.398 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, JdkPlugin, Owb, Proxy, WebObjects, Weld, JBossModules, Undertow]

    I need now to understand this NullPointerException

    Caused by: java.lang.NullPointerException
        at org.hotswap.agent.config.PluginRegistry.getPluginClass(PluginRegistry.java:293)
    Vladimir Dvorak
    @skybber
    Probably system class loader is null
    Vladimir Dvorak
    @skybber
    Probably correct version of PluginRegistry.getPluginClass for null bootstrap classloader is:
    protected Class<Object> getPluginClass(String pluginClass) {
        try {
            // noinspection unchecked
            if (getClass().getClassLoader() == null) {
                return (Class<Object>) Class.forName(pluginClass, true, null);
            }
            return (Class<Object>) getClass().getClassLoader().loadClass(pluginClass);
        } catch (ClassNotFoundException e) {
            throw new IllegalArgumentException("Plugin class not found " + pluginClass, e);
        }
    }
    I've never investigated why the bootstrap class loader could be null, since I had never faced to this problem
    Graziano Felline
    @ogipogi
    Thank You Vladimir for the additional infos
    Vladimir Dvorak
    @skybber
    If it fix your problem, we can add the fix to ha-core
    Graziano Felline
    @ogipogi
    I will test this
    Vladimir Dvorak
    @skybber
    thanks
    I don't have JbossEAP at all ...
    Graziano Felline
    @ogipogi
    :)
    I have problems to build a local SNAPSHOT jar
    Vladimir Dvorak
    @skybber
    OK, I'll prepare it
    Graziano Felline
    @ogipogi
    Thank you very much
    Vladimir Dvorak
    @skybber
    snapshot updated
    Graziano Felline
    @ogipogi
    ok, I'll test it
    Vladimir Dvorak
    @skybber
    btw, you need dcevm11 to build HA
    Graziano Felline
    @ogipogi
    Ahh, that was maybe the issue
    Vladimir Dvorak
    @skybber
    I'm using dcevm11 as system jdk now for a week
    Graziano Felline
    @ogipogi

    I tested it:

    • activemq is deployed
    • New exception during deployment of Camunda engine
    14:46:08,971 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 69) MSC000001: Failed to start service jboss.deployment.unit."camunda-webapp-ee-jboss-7.11.11-ee.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."camunda-webapp-ee-jboss-7.11.11-ee.war".undertow-deployment: java.lang.NoClassDefFoundError: io/undertow/server/handlers/resource/ResourceManager
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:485)
    Caused by: java.lang.NoClassDefFoundError: io/undertow/server/handlers/resource/ResourceManager
        at java.lang.ClassLoader.findBootstrapClass(Native Method)
        at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1009)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:408)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:406)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
        at java.lang.ClassLoader.findSystemClass(ClassLoader.java:998)
        at org.jboss.modules.ConcurrentClassLoader.findSystemClassInternal(ConcurrentClassLoader.java:416)
        at org.jboss.modules.JDKSpecific.getSystemClass(JDKSpecific.java:180)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:395)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
        ... 8 more

    I need to investigate what happened