JPDAを使用してSpringによってロードされたクラスのJVMのホットスワップ

StackOverflow https://stackoverflow.com/questions/5413060

質問

このトピックについての彼の経験を誰かに教えてもらえますか?

Tomcatでjpdaを使用する場合、Spring経由でロードされたクラスでもクラスのリロードは機能しますか?いくつかのクラスがロードされてインスタンス化されたSpringコンテキストがあり、そのうちの1つでメソッドを変更したいとします。

通常、クラスは置き換えられ、再ロードされ、他のすべてのインスタンスは新しいバージョンのクラスからインスタンス化されます。古いインスタンスでさえ古いものに置き換えられていると思いますか?

これはSpringを使用した場合にも機能しますか?だから私はmvcコントローラーを持っていて、その方法を変更しますか?

または、この要件にJRebelを使用する必要があります。

役に立ちましたか?

解決

My experience with this is that it works well and reliably, provided you don't of course change the method signature, add fields etc. Changing the implementation of any existing method of any class in the spring container (MVC controllers included) should work entirely as expected. For reference, the last time I tested this was with Tomcat 6, Spring 3 and using Netbeans 6.9's "Apply Code Changes" over a remote attached debugger, but it's Java standard so I doubt the IDE will effect it much.

EDIT: None of the above concerns JRebel (I've never used it).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top