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
Hotswap agent does not support hot reloading when you modify the class defination..
For example , below changes will not hot reload the java file.
Below changes will get hot reloaded.
Hi Krutik,
I am only modifying code under executeImpl() method of sample webscript, then also it is giving above error.
The Error says that you have added new method in java class.Have you applied patch to JDK?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.