Eclipse for hot deployment and hot start

Source: Internet
Author: User

(1) Hot deployment: It is the container state that deploys the entire project in the case of running. In this case, the general memory will be emptied and reloaded. In short, Tomcat or other Web servers will help us reload the project. This approach can cause sessin loss and so on.

(2) Hot load: Is the container state in the case of running reload changes to the compiled class. In this case, the memory will not be emptied, the sessin will not be lost, but it may cause memory overflow, or the method cannot be found. Because memory cannot be turned into a pair of images. General changes in the structure and model of the class will have an exception, in the existing variables and methods to change is not a problem

Class Loaders play an important role in the Java-based implementation of thermal deployment and thermal loading. The class loader cannot reload a class that has already been loaded, otherwise it will report java.lang.LinkageError, but as long as a new class loader instance is used, the class can be loaded again into a running application. Hot loading is supported in general debug mode.

But here I am. Eclipse uses debug startup without a hot load, which is time-consuming for development because the class file needs to be recompiled every time it is changed. Here's a quick introduction to how to use Eclipse for hot loading:

Start Eclicpse Find the following directory

Open Server.xml and find

<context docbase="dreamlive" path="/root" reloadable= " false " crosscontext="true" source="org.eclipse.jst.jee.server :d reamlive"/>  

This line of code, when you deploy a new project, Docbase and source will change, and now the state of the hot deployment, so that each change to the class file will be automatically compiled, more time-consuming, then we change the configuration:

<context docbase="dreamlive" path="/root" reloadable= " false " crosscontext="true" source="org.eclipse.jst.jee.server :d reamlive"/>

This changes the reloadable to false, adding crosscontext= "true", so that hot start can be done, note: the need to start with debug

However, we need to change this configuration every time we deploy a new project, and we can observe the dynamic change of the Server.xml file each time we deploy a new project.

Eclipse for hot deployment and hot start

Related Article

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.