Eclipse 热代码替换失败 - 重新发布 Web 应用程序
我在 Tomcat 上的 Web 应用程序中使用热插拔 Java 调试功能。在进行一些类签名更改后,我收到“热代码替换失败”Eclipse 对话框 - 我明白这一点。
在这种情况下,我想要的是重新发布应用程序(我可以做到)并使用新部署的代码。然而,调试器仍然抱怨,直到我重新启动服务器。因为其他应用程序和长时间启动我不希望这样。
有没有办法告诉调试器,新的类版本已经在新的 webapp 类加载器中重新加载,并且已保存以继续?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不试试 JRebel 呢?
JRebel 是一个 JVM Java 代理,它与应用程序服务器集成,使类可以使用现有的类加载器重新加载。只有更改的类才会重新编译并立即重新加载到正在运行的应用程序中。
JRebel 插入 IDE 并构建系统。类和静态资源直接从工作区加载。
http://zeroturnaround.com/software/jrebel/
问候,
安德里亚
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
有一个旧的博士项目。制作它的人是由 Oracle 带来的,但他的工作并没有出现在 Java 8 中,希望能在 Java 9 中看到,但更有可能出现在 Java 10 中。我猜 Java 8 有一个新版本。我还没试过。
我最初的问题是为了获取更多信息:JDK 8 中的高级代码热交换?
以及 Github 上的项目页面:https://github.com/dcevm/dcevm
有了这个,您可以热替换几乎任何类更改,使您无需重新启动 JDK。 (除了静态对象和单例的副作用之外,但这也是合乎逻辑的)
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)
您是否尝试过“服务器选项 - 不发布而提供模块”以及“发布”?
也不确定您对其他应用程序的评价。
Did you try Server Options - Serve modules without publishing along with Publishing?
Also not sure what you are saying about other apps.