Eclipse in Tomcat in Hot Deployment Engineering
1. Install a Tomcat plugin in Eclipse China: sysdeoeclipse Tomcat Launcher plugin (http://www.eclipsetotale.com/tomcatPlugin.html )
2. Create a new Web project, such as: Hello
3. Configure the Tomcat server. Open menu window-"preferences-" Tomcat
There are two options for context declaration mode, which is to specify whether the configuration of the application (Context) is placed in server.xml or in a separate folder. This is used when the interface is configured.
Click "OK" to complete the configuration.
4. Open the Contexts directory directories above, that is: Tomcat\conf\catalina\localhost. To build an XML file in the directory, write the content:
<? XML version= ' 1.0 ' encoding= ' utf-8 ' ? ><! - It doesn't matter if it's written or not-- >
< Context Path = "/hello" DocBase = "E:\workspace\hello\WebRoot" reloadable = "true"/>
can also be added under \conf\server.xml <Host><Host/> node
< Host >
< Context Path = "/hello" DocBase = "E:\workspace\hello\WebRoot" reloadable = "true"/>
< Host />
Attached: the context element in Tomcat is detailed
There is also an easy way to configure through the interface. Right-click Project-"Select Properties"
After the configuration is complete. You can see that a hello.xml file was generated in the Tomcat\conf\catalina\localhost directory. (The two configurations of context Declarationmode in the first diagram are to configure where this file is placed)
5. Click the kitten icon to start Tomcat.
The above approach achieves the basic thermal deployment, and the development efficiency improves a lot. However, when you append a method or class variable, you are prompted to restart.
Other hot deployment plug-ins are also available. Jrebel plugin. The Jrebel is chargeable.
In addition, MyEclipse has been integrated with similar functions, or very useful. Just feel myeclipse too big and bloated.
Tomcat often reports the following error when it launches in a Web project
: java.lang.ClassNotFoundException: Org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
That's because the jar file is missing Spring-tomcat-weaver.jar, which needs to be placed in Tomcat's Lib directory.
Eclipse Hot Deployment Project in Tomcat