Not able to achieve hot reloading in alfresco sdk 3.0

cancel
Showing results for 
Search instead for 
Did you mean: 
vikash_patel
Established Member

Not able to achieve hot reloading in alfresco sdk 3.0

I am trying to achieve hot reloading by following this Using HotSwapAgent | Alfresco Documentation link.

After completing all steps when I am making changes in sample webscript java file it is giving following error and changes are not getting reflected.

Exception in thread "Thread-69" 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

Thanks,

Vikash

3 Replies
krutik_jayswal
Senior Member II

Re: Not able to achieve hot reloading in alfresco sdk 3.0

Hotswap agent does not support hot reloading when you modify the class defination..

For example , below changes will not hot reload the java file.

  • Modifying the method name
  • Modifying the method parameter
  • Changing the class name
  • Adding new class etc..

Below changes will get hot reloaded.

  • Adding code inside any method
  • Modifying method body etc..
vikash_patel
Established Member

Re: Not able to achieve hot reloading in alfresco sdk 3.0

Hi Krutik,

I am only modifying code under executeImpl() method of sample webscript, then also it is giving above error.

krutik_jayswal
Senior Member II

Re: Not able to achieve hot reloading in alfresco sdk 3.0

The Error says that you have added new method in java class.Have you applied patch to JDK?