3

I am using Eclipse IDE for Java Developers

Version: Helios Service Release 1 Build id: 20100917-0705

In remote debugging Web app with tomcat 7.0.37, when I make some changes, even a line, the changes can not be made into the runtime, so I need to recompile and re-deploy the war application. Wast a lot of time. The message:

Hot code replace failed - Delete method not implemented

I do not understand the message.

Anyone know the secret on how to auto reflect the code change in debug mode? Thanks.

3 Answers 3

3

I've found that for hot code replacement to work the code being modified/replaced must be in the execution stack. So you can hot replace changes made to a method you've stopped in, but you can't hot replace changes to that method once you step out of that method... unless you first stop back in the method on a successive call to the method.

Sign up to request clarification or add additional context in comments.

Comments

1

With the standard JVM (Oracle's), you can only modify existing methods. Both adding and deleting methods, and changing structure of class (moving methods, fields) are NOT supported. For that, go to JRebel!

One thing to notice is that changes to seemingly "normal code" inside some method will actually need for the java compiler to add or delete methods - and hence it will fail. This happens e.g. if you in an inner class accesses private fields in the outer class - the java compiler will need to add synthetic accessor-methods to the outer class to let the inner class access those fields - which hence will fail to Hot Code Replace. Also, if you remove some code accessing such fields, the java compiler wants to remove the corresponding synthetic accessor-method, which also will fail.

Comments

-2

I think there is no way to reflect the code change in debug mode

  • Debug mode is to trace program flow and find if any issues or errors at particular piece of code....
  • it just points to line of code in eclipse, which is running in your tomcat, ie. code in eclipse is not used to run application the code u have installed or put in tomcat runs

hence your changes made in eclipse cant reflect in tomcat code

2 Comments

sometimes it works, like 5%, it is called Hot Code Replacement.
Oh please.. Get a clue about what you are answering before doing just that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.