Maven + Tomcat + Eclipse Java hotswap

I have a problem. I start Tomcat in JPDA mode and after that I do:

mvn tomcat:stop tomcat:undeploy war:inplace tomcat:inplace 

Then I connect to the remote Java application from Eclipse. Everything works fine, I can change the code and work with hot swap.

When I add method / change parameters, I redeploy the application:

 mvn tomcat:stop tomcat:undeploy war:inplace tomcat:inplace 

After which, when I reconnect to a remote java application, only now, when I change any file (for example, taking up space or deleting a space, save), I get an error message that the code cannot be replaced - " "Hot Code Replace Failed - add method not implemented" .

What is the problem?

Thanks.

+2
source share
2 answers

The JVM only supports hot swapping for changes to the method body. For other changes, such as changing parameters or adding new methods, consider choosing the JRebel that supports them.

0
source

Spring Loaded The JVM agent should work better. Firstly, it has new parameters and methods that are not available when replacing the hot JVM code. I recently got this setup and verified that the new methods in existing classes work as expected.

0
source

All Articles