Hot code replace fail

Source: Internet
Author: User

Eclipse/myeclipse is used for Java code development, especially for Web application development. Generally, configuration files (such as web. XML) restart the server to take effect. modify the JSP page without restarting.

 

If you modify a Java file, there are two situations:

1. Small-scale modifications, without changing the block structure of the class, can take effect immediately without restarting the server (the premise is to synchronize the release, that is, you need to check the menu project-> build automatically)

2. modified the class structure (such as adding or deleting class methods and fields ). in this case, myeclipse will prompt "Hot code replace fail" and explain the cause of the failure (for example, add method not implemented, scheme change not implemented, etc ), the system prompts you to restart the server. in this case, the server must be restarted to take effect.

3. in another case, make minor changes to the Java file (for example, add a space in the unimportant part of the Code) and save the changes. myeclipse will also prompt hot code replace fail. the chances of this situation are very small. in this case, multiple web applications are released under the server (such as Tomcat, the modified class name exists in multiple Web applications (for example, app1 and app2, app1 has a class COM. company. loginaction, app2 also has a class COM. company. loginaction. modified the loginaction in app1 ).

I guess: Before JVM performs hot code replace, it compares the modified class (loginaction in app1) with the same name class in another application (loginaction in app2, it is found that there are structural differences between the two, so we think this class has changed a lot and cannot perform hot code replace.

 

There is a simple way to verify whether it is in the third case. only one project is deployed on the server. After the project is started, modify the Java class. If it is a small modification, myeclipse will not prompt the hot code replace fail at this time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.