HotswapProjects / HotswapAgent

Java unlimited redefinition of classes at runtime.
GNU General Public License v2.0
2.32k stars 491 forks source link

Spring + Resteasy #209

Open lRawd opened 7 years ago

lRawd commented 7 years ago

I am running Spring 4.3.2 with Resteasy 3.1.1. When I modify one of my Resteasy web service beans, the class is reloaded but all my autowired spring beans are now null in that class.

lRawd commented 7 years ago

Attempted to disable ReasteasyRegistry plugin but that causes the following exception to be thrown when a rest resource is accessed:

Caused by: java.lang.IllegalArgumentException: Plugin class org.hotswap.agent.plugin.resteasy.ResteasyRegistryPlugin is not initialized in classloader ModuleClassLoader for Module "deployment.app-web.war:main" from Service Module Loader.
    at org.hotswap.agent.config.PluginRegistry.getPlugin(PluginRegistry.java:199)
    at org.hotswap.agent.config.PluginManager.getPlugin(PluginManager.java:77)
    at org.hotswap.agent.config.PluginManager.getPlugin(PluginManager.java:62)
    ... 91 more

Recompiling HA without the plugin works, and I keep my spring beans, but I am obviously unable to add/modify Paths.

skybber commented 7 years ago

Did you try to disable plugin using global option -javaagent:hotswapa-gent.jar=disablePlugin=ReasteasyRegistry ?

lRawd commented 7 years ago

I was using the properties file. Using the global option seems to work for properly disabling the plugin.