In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the methods of hot deployment and hot startup of Eclipse/tomcat. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
1. Hot deployment: the container state redeploys the entire project while it is running. In this case, the whole memory is usually emptied and reloaded. To put it simply, Tomcat or other web servers will help us reload the project. This approach may result in situations such as the loss of session.
2. Hot loading: the container state reloads the compiled class while it is running. In this case, the memory will not be emptied and the sessin will not be lost, but it is easy to cause a memory overflow or a method cannot be found. Because memory cannot be converted into an object. In general, there will be exceptions if you change the structure and model of the class, and it will not be a problem to change in the existing variables and methods.
Eclipse configuration hot boot:
Class loader plays an important role in the process of hot deployment and hot loading based on Java. 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 into a running application again. Hot loading is generally supported in debug mode.
But here I encounter a situation where eclipse starts with debug without hot loading, which is very time-consuming for development because the class file needs to be recompiled with each change. Here's a brief introduction to how to use eclipse for thermal loading:
Start eclicpse to find the following directory
Open server.xml and find
In this line of code, docBase and source will change when you deploy a new project, and they are still hot deployed, so every time you change the class file, it will be compiled automatically, which is time-consuming. Next, let's change the configuration:
The copy code is as follows:
Here, change reloadable to false, and add crossContext= "true" so that you can start hot. Note: you need to start with debug.
However, we need to change the configuration every time we deploy a new project. We can observe the dynamic changes of the server.xml file each time we deploy a new project. If the hot load of the startup project does not take effect after the setting is completed, then check eclipse-- > project-- > Build Automatically, plus automatic compilation.
The meaning of each attribute is attached below
Path shows you the way to visit
DocBase indicates your storage path.
Debug provides the least information for setting debug level 0, and 9 provides the most information.
In reloadable=true, when web.xml or class changes, it will reload automatically without restarting the service.
Crosscontext= "true" means that different configured context share a session (may not be configured)
Tomcat configuration warm start
The specific methods are as follows:
Step 1: under the Tomcat installation directory, modify the Host configuration in conf/server.xml, set its reloadable attribute to true, that is, add reloadable= "true" to the Host tag, and restart Tomcat to make the configuration file effective.
Step 2: add to the web.xml file in the conf folder
Development true
Step 3: restart the tomcat server to make the changes take effect.
This is the end of the article on "Hot deployment and Hot start of Eclipse/tomcat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.