Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Zakaria Amine
    @zak905
    extraClasspath=compile/JavaEcho.class
    autoHotswap=true
    when I run the app , and modifiy something and compile again I see something like:
    HOTSWAP AGENT: 20:48:40.987 RELOAD (org.hotswap.agent.config.PluginManager) - Reloading classes [JavaEcho] (autoHotswap)
    which means that the agent receives the event
    but the changes are not applied
    am I missing on something here?
    Vladimir Dvorak
    @skybber
    Hi, are you using dcevm?
    Zakaria Amine
    @zak905
    Yes off course
    java -XXaltjvm=dcevm -javaagent:/home/zakaria1/Downloads/hotswap-agent-1.0.jar -cp . JavaEcho
    Jiri Bubnik
    @edudant
    Hi, split your main method into two seperate methods - main with while cycle and reader() with the rest. Change of active method is generally not supported (although in some cases it is possible)
    Zakaria Amine
    @zak905
    @edudant thanks for your suggestion, it still does not work. Maybe static methods are not supported
    Vigneshwaran
    @imvigneshb
    Can anyone guide me to configure Hotswapagent into my STS for Spring Hibernate project with JPA, Hibernate-Validator
    Zakaria Amine
    @zak905
    are you using Spring boot ?
    Vigneshwaran
    @imvigneshb
    Nope..
    Am using Spring WebMVC
    Zakaria Amine
    @zak905
    ok how are you deploying the app ? on Tomcat?
    Vigneshwaran
    @imvigneshb
    Yes in tomcat
    Zakaria Amine
    @zak905
    so you have to create a hotswap-agent.properties in src/main/resources
    Vigneshwaran
    @imvigneshb
    ok in that properties what i need to mention
    Zakaria Amine
    @zak905
    extraClasspath=WEB-INF/classes
    autoHotswap=true
    and add the HotSwap JVM args to Tomcat
    and then when you need to reload your project, you can recompile it and redirect the compilation out put to your webapps/yourapp/WEB-INF/classes
    Vigneshwaran
    @imvigneshb
    Thanks for the help @zak905 . I will try with my project
    Vigneshwaran
    @imvigneshb
    It's always throwing Error refreshing BeanMetaDataManagerCache/AnnotatedMetaDataProvider cache.
    vikrantch-hk
    @vikrantch-hk
    Hi team does this project supports reloading of Spring beans also say I am using spring boot and creating some controller or service beans will they be loaded without application restart
    vikrantch-hk
    @vikrantch-hk
    @zak905 please let me know answer for my query above
    Zakaria Amine
    @zak905
    @vikrantch-hk Yes it works wit spring boot, here is a blog post I wrote recently about it: http://www.zakariaamine.com/2018-01-06/using-hotswap-agent-to-reload-code
    vikrantch-hk
    @vikrantch-hk
    @zak905 thanks a lot I am able to hot swap Spring components, but seems like hibernate entities aren't getting hot swapped.
    Vladimir Dvorak
    @skybber
    @zakaria : nice written article !
    Zakaria Amine
    @zak905
    thanks! I appreciate
    vikrantch-hk
    @vikrantch-hk
    @zak905 is there any additional changes for hotswapping new hibernate entities. I am getting unknown entity exception for hotswapped entities
    I have never tried with hibernate
    vikrantch-hk
    @vikrantch-hk
    @zak905 thanks
    vikrantch-hk
    @vikrantch-hk
    I am getting 'failed to create java virtual machine' error in eclipse while switching workspace , has anybody faced same issue
    Vladimir Dvorak
    @skybber
    I don't have this problem. I'm using more separated workspaces and choose one of them on eclipse start, even I don't know that it is possible to switch workspaces when working in another one.
    vikrantch-hk
    @vikrantch-hk
    @skybber i removed -vm and -vmargs from eclipse.ini and it worked
    vikrantch-hk
    @vikrantch-hk
    can we enable hot swapping while debugging also, as of now my application restarts on adding new classes
    vikrantch-hk
    @vikrantch-hk
    @skybber please help
    Vladimir Dvorak
    @skybber
    You should disable auto realoding on Modules page in Sever Setup
    vikrantch-hk
    @vikrantch-hk
    @skybber hot to disable auto reload if using spring boot's embedded tomcat
    vikrantch-hk
    @vikrantch-hk
    @skybber is there any way to hotswap while doing remote debugging
    Vladimir Dvorak
    @skybber
    There is no problem to do hotswap when remote debugging. But only the modification of class is allowed, creating a new class is not supported. You should copy new classes to destination beforehand hotswap to support this kind of change.
    vikrantch-hk
    @vikrantch-hk
    @skybber is there any way to configure this in intellij (copying new classes to destination) using maven
    Vladimir Dvorak
    @skybber
    I'm not expert on Intellij, but you can definitely use some external tool to synchronize it. New class must be copied to destination before it is used (loaded) by JVM
    Andreas Resios
    @resios

    I'm trying to build the master branch for hotswap (mvn clean install -DskipTests) to get the latest patches but when I try to run it in the JVM I'm getting the following stacktrace:

    HOTSWAP AGENT: 11:56:11.320 DEBUG (org.hotswap.agent.plugin.jvm.ClassInitPlugin) - Skipping old field log
    HOTSWAP AGENT: 11:56:11.322 DEBUG (org.hotswap.agent.plugin.jvm.ClassInitPlugin) - Skipping old field savedBeers
    HOTSWAP AGENT: 11:56:11.322 DEBUG (org.hotswap.agent.plugin.jvm.ClassInitPlugin) - Skipping old field nextBeerId
    Exception in thread "Thread-19" java.lang.IllegalStateException: Unable to redefine classes
            at org.hotswap.agent.config.PluginManager.hotswap(PluginManager.java:276)
            at org.hotswap.agent.plugin.hotswapper.HotswapperPlugin$1.executeCommand(HotswapperPlugin.java:94)
            at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)
    Caused by: java.lang.UnsupportedOperationException: class redefinition failed: attempted to add a method
            at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
            at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170)
            at org.hotswap.agent.config.PluginManager.hotswap(PluginManager.java:272)
            ... 2 more

    This seems similar with #162, but I've verified that the JVM has dcevm installed and it's used.
    Also if I switch back to the latest official release, it starts working again.

    I tried running mvn release:prepare release:perform but it fails to generate a jar file.
    For building I'm using Oracle JDK 1.8.0_151
    For running I'm using Oracle JDK 1.8.0_144

    Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
    Dynamic Code Evolution 64-Bit Server VM (build 25.71-b01-dcevmlight-2, mixed mode)

    Any help would be appreciated.

    Andreas Resios
    @resios
    @resios I found the problem. As indicated by the stacktrace, dcevm was not used. Apparently if java is started with the -server flag, the -XXaltjvm=dcevm -javaagent:/home/deceneu/hotswap/hotswapagent/hotswap-agent-1.1.0-SNAPSHOT.jar need to be after it, otherwise the -XXaltjvm=dcevm is ignored. After re-positioning the arguments, everything works as expected.
    Alexander Bartash
    @AlexanderBartash
    Hi guys, hi @skybber I am trying to figure out why version 1.1.0 works in my project based on SAP Hybris platform and 1.2.0 does not. Do you have any information how to debug hotswap agent? I am particularly interested in Spring Plugin.
    Alexander Bartash
    @AlexanderBartash
    More precisely 1.2.0 works but it screws up spring context in the runtime and the app does not start. 1.2.1 does the same and logs additional errors.
    Vladimir Dvorak
    @skybber
    Hi, thanks for info. I don't have any experience with Hybris neither I have any prepared tests for it. But may be you can find out of your own. It is not so hard to do. All what you need is the last working commit ID and then you can do "git bisect" on repository and build/test each itermidiate version. We don't have too much versions since 1.1