Maven + Tomcat + Eclipse Java hotswap
Asked Answered
R

2

2

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

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

After which I connect to remote Java app from Eclipse. All works ok, I'm able to change some code and hot swap works.

When I add method/change parameters I redeploy the app:

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

After which when I reconnect to the remote java app again, only now when I change any file (for example, placing a space or removing space, save) I get an error that code cannot been swapped out - "Hot Code Replace Failed - add method not implemented".

What is the problem?

Thanks.

Rubious answered 5/3, 2012 at 19:17 Comment(1)
seems like choosing plexus-compiler-eclipse as compiler is solving this problem, I'm testing it.Rubious
B
0

JVM only supports hot swap for changes to the method body. For other changes, like changing the parameters or adding new methods, consider choosing JRebel which supports these.

Boaster answered 6/9, 2012 at 23:3 Comment(0)
A
0

The Spring Loaded JVM agent should work better. For one, it has the new parameters and methods feature that is lacking with current JVM hot code replace. I recently got this setup and verified that new methods in existing classes work as expected.

Airel answered 6/5, 2016 at 17:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.