SDK3 - HOTSWAP - Doesn't work

Showing results for 
Search instead for 
Did you mean: 
Active Member II

SDK3 - HOTSWAP - Doesn't work

Hi, Hotswap seen doesn't work on any artifact genration :

HOTSWAP AGENT: 15:37:42.619 RELOAD (org.hotswap.agent.config.PluginManager) - Reloading classes [] (autoHotswap)
Exception in thread "Thread-240" java.lang.IllegalStateException: Unable to redefine classes
        at org.hotswap.agent.config.PluginManager.hotswap(
        at org.hotswap.agent.plugin.hotswapper.HotswapperPlugin$1.executeCommand(
Caused by: java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields)
        at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
        at sun.instrument.InstrumentationImpl.redefineClasses(
        at org.hotswap.agent.config.PluginManager.hotswap(
        ... 2 more

Anywhere, I don't try to create new method or classe, just add new space on java code.

Have you the same bug?

2 Replies
Senior Member II

Re: SDK3 - HOTSWAP - Doesn't work

AFAIK with hotswap agent you will be only able to hot reload thing which are not modifying the schema of classes.

For example if you are modifying the code inside method it will work.But if you are renaming/adding new method then it will not be able to reload it.

You can use jrebel for that i guess.

Active Member II

Re: SDK3 - HOTSWAP - Doesn't work

Thinks you for your response.

I know this point. Step to reproduce :

1) create javadir-context.xml with this content :

<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns=""
    xmlns:xsi="" xmlns:context=""

    <context:component-scan base-package="com.xx.ged" />
    <context:annotation-config />


2) Create Class :

public class YourClass{

    SiteBusiness siteBusiness;

    public void importCsvDataToAlfresco(String text) {
        System.out.println("This is message from Alfresco : " + text);

3) Start embedded server with hotswap

4) change the content text of printLn, and you have this error :

Exception in thread "Thread-240" java.lang.IllegalStateException: Unable to redefine classe