HotswapProjects / HotswapAgent

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

Hot swapping of java code fails even though HotSwapAgent is aware of the classes #399

Open Si-So opened 3 years ago

Si-So commented 3 years ago

Hi,

I have a webapp that I run using tomcat. While tomcat was running, I successfully hot-swapped java code in my webapp. Tomcat runs on dcevm-11.0.11+1.

However, I also have classes from another java project that my webapp calls. When hot-swapping code within this other java project, hot-swapping does not work, even though HotSwapAgent is aware of these classes. Here are the relevant log-outputs from HotSwapAgent:

HOTSWAP AGENT: 17:27:53.485 INFO (org.hotswap.agent.watch.nio.TreeWatcherNIO) - Registering directory C:\HIS-Workspace\Tomcat\tomcat-head_hot-swap\eclipse-workspace\cs.psv.account.generator\bin
(...)
HOTSWAP AGENT: 17:36:07.405 INFO (org.hotswap.agent.plugin.spring.scanner.XmlBeanRefreshCommand) - Executing XmlBeanDefinitionScannerAgent.reloadXml('file:/C:/HIS-Workspace/Tomcat/tomcat-head_hot-swap/eclipse-workspace/cs.psv.account.generator/bin/extension.beans.spring.xml')
HOTSWAP AGENT: 17:36:07.406 INFO (org.hotswap.agent.plugin.spring.scanner.XmlBeanDefinitionScannerAgent) - Reloading XML file: file:/C:/HIS-Workspace/Tomcat/tomcat-head_hot-swap/eclipse-workspace/cs.psv.account.generator/bin/extension.beans.spring.xml
HOTSWAP AGENT: 17:36:07.549 INFO (org.hotswap.agent.plugin.spring.getbean.DetachableBeanHolder) - 529 Spring proxies reset

What do I need to change to enable hot-swapping of java-code in this project?

skybber commented 2 years ago

Probably wrong setup, I'm using hotswap with multiple app on Tomcat without problem. Did you solve it?