by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alain Tavan
    @alain57
    @mryvz after saving process, java build new classes and reload them this takes a bit.
    On the project i'm working building new classes takes also 10-15 secondes
    you need to wait after the IDE told you that the classes where reloaed or do you try to refresh the webpage directly after pressing save without waiting that everything was reloaded?
    Vladimir Dvorak
    @skybber
    Hi, just fork the repository, create your travis account, add forket project and build :) java10 is used for build java11 image
    forked ...
    David Brown
    @davebrown1975
    Hi all - has anyone used hotswap with success on a Grails 4 project?
    If this works well, you're likely going to have a flood of Grails developers looking to avoid being forced to use jRebel just to remain productive since Grails 4 uses a later version of spring boot so no longer has the magic behind hot-swapping of classes which was one of the attractions of the framework in the first place.
    mryvz
    @mryvz
    @alain57
    i dont think its compile issue , im using compile on save option in netbeans. Save configuration with tomcat working almost insta ,
    as you sugested i refresh page without waiting classes updated message but nothing :( ,
    in my opinion wildfly (thorntail) has internal classpath something like search deamon which has 10 secs period
    Vladimir Dvorak
    @skybber
    extraClasspath is supported on wildfly. I dont know if netbeans use JDI to hotswap classes, but extraClasspath + autohotswap could work. As I know Kotlin and Scala works with dcevm+hotswagent
    Guilherme Chafy
    @guichafy
    Hi guys, The Hotswap Agent there are support to replace JSP files in Jboss?
    Vladimir Dvorak
    @skybber
    Hi, it could work, bute there is some threads relating to JSPs at https://groups.google.com/forum/#!forum/hotswapagent , otherwise I've no personal experience with JSP hotswap
    gkna
    @gkna
    Hi, i have done successful integration of Hotswap Agent(used openjdk11) with wildfly. I have connected wildfly with remote debugger from eclipse. Code changes are getting reflefcted only for methods. If i add a new class it is not getting swapped to the wildfly, i am getting java.lang.NoClassDefFoundError. Can anyone help me how i can fix this?
    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 ...