Eclipse Hot Code Replace Fail - republish web appl

2019-04-28 14:16发布

I use the Hot Swap java debugging feature with web app on Tomcat. After some class signature change, I got "Hot Code Replace Fail" Eclipse dialog - I understand that.

What I want in such case is to republish the application (I can do that) and work with the newly deployed code. However the debugger stil complains, until I restart the server. Because other apps and long startup I don't want that.

Is there a way how to tell to the debugger, that there is the new class version already reloaded in a new webapp classloader and that it is save to continue?

Thanks.

3条回答
何必那么认真
2楼-- · 2019-04-28 14:36

Why don't you try with JRebel? JRebel is a JVM Java Agent that integrates with application servers, making classes reloadable with existing class loaders. Only changed classes are recompiled and instantly reloaded in the running application. JRebel plugs into IDEs and build systems. Classes and static resources are loaded straight from the workspace. http://zeroturnaround.com/software/jrebel/

Regards, Andrea

查看更多
相关推荐>>
3楼-- · 2019-04-28 14:38

Did you try Server Options - Serve modules without publishing along with Publishing?

Server Options
Publishing

Also not sure what you are saying about other apps.

查看更多
看我几分像从前
4楼-- · 2019-04-28 14:46

There is a old PHD project. The guy who made it was brought by Oracle but his work didnt made it to the Java 8 and hopefully will be seen in Java 9 but is more likely to be in Java 10. There is a new Version of this for Java 8 I guess. I havent tried it yet.

My Original Question for additional information: Advanced Code Hot Swapping in JDK 8?

And the Project page on Github: https://github.com/dcevm/dcevm

With this you can hot replace almost any class change freeing you from restarting the JDK ever after. (beside sideeffects for static objets and singletons but that would be logical)

查看更多
登录 后发表回答