0

I am developing a web application and the feature to hot swap classes provided in Intellij IDEA is very useful for me. But, hot swap doesn't always succeed and IDEA reports that hot swap failed.

By looking at the code change I have done, is there a way to identify that a hot swap attempt will fail or not? So I can directly start a new debugging session instead of trying to hot swap?

Lahiru Chandima
  • 22,324
  • 22
  • 103
  • 179
  • What is the reason provided for the failure? – christopher May 20 '15 at 07:27
  • I think it depends on the change I have done. Here is one of the error messages. `Hot Swap failed Tomcat: delete method not implemented; Tomcat: Operation not supported by VM` – Lahiru Chandima May 20 '15 at 07:30
  • I don't think that is linked to the code. I think it is linked to the state of the JVM at the time. – christopher May 20 '15 at 07:32
  • But if I do different changes at the same line, one change may hot swap while other may not – Lahiru Chandima May 20 '15 at 07:34
  • That doesn't mean the state of the VM hasn't changed also, but okay. I'll look into this and get back to you. – christopher May 20 '15 at 07:35
  • Have you had a look here: http://stackoverflow.com/questions/2056628/hot-code-replace-failed-eclipse ? – christopher May 20 '15 at 07:36
  • Yes. But I am mot running any test case. Also I am compiling in debug mode. – Lahiru Chandima May 20 '15 at 08:28
  • My guess is if the computed serialVersionId of the class changes (even if it's not a `Serializable` class), then hot-swapping isn't going to work. More specifically, if you change the code within a method, you're okay. But if you change the definition of the class (add/subtract members or methods), then it will fall-over. – Christopher Schultz May 21 '15 at 17:20

0 Answers0