Integrated Tomcat in Eclipse

Source: Internet
Author: User

One, create a new server in eclipse


Window->preferences->server->runtime Environment


650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/80/42/wKioL1c8RprjpLt7AACZkZ2hd4A101.jpg "title=" 1.jpg " alt= "Wkiol1c8rprjplt7aaczkz2hd4a101.jpg"/>



650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/80/45/wKiom1c8RcahTBQDAAB4zh7q9w0672.jpg "title=" 2.jpg " alt= "Wkiom1c8rcahtbqdaab4zh7q9w0672.jpg"/>



Ii. configuring Tomcat in the server view



650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/80/42/wKioL1c8R5HD5g2dAABDO-KjRzA842.jpg "title=" 3.jpg " alt= "Wkiol1c8r5hd5g2daabdo-kjrza842.jpg"/>



650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/80/42/wKioL1c8R6SDpq_QAACpaaHkKco761.jpg "title=" 4.jpg " alt= "Wkiol1c8r6sdpq_qaacpaahkkco761.jpg"/>




650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/80/45/wKiom1c8RtDT5ggYAABtlGRTiRc848.jpg "title=" 5.jpg " alt= "Wkiom1c8rtdt5ggyaabtlgrtirc848.jpg"/>




650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/80/45/wKiom1c8RuTxFneWAADW1Ftoe-4063.jpg "title=" 6.jpg " alt= "Wkiom1c8rutxfnewaadw1ftoe-4063.jpg"/>


Note: If a project is deployed in this tomcat, the options in the red circle will be dimmed and cannot be modified, and the modifications must first be removed from the deployed service in Tomcat.



Select Use Tomcat installation (Task control of Tomcat installation)

That is, choose Tomcat's installation directory as the project's publishing directory, and after selecting the item, the Server path becomes the Tomcat installation directory.


Next, there is a deploy path deployment directory, the default is Wtpwebapps, to the Tomcat publish directory WebApps


After you change the configuration to save the shutdown, after you start the new Tomcat in Eclipse, you can access the localhost:8080 normally.


Problems encountered:

1. The configuration file synchronization of Tomcat in eclipse integrated with Tomcat in the original directory is unidirectional, if the configuration in the original Tomcat directory is modified and Tomcat is restarted in Eclipse, the configuration in the original Tomcat directory is flushed out. The correct approach is to first pass the configuration file in the server project in eclipse, so that Tomcat is restarted in Eclipse, and the modified configuration is synced to the original directory of Tomcat

2. Tomcat, integrated in Eclipse, adds a sentence to the server.xml of Tomcat in the original directory.

<context docbase= "Fish-web-arch" path= "/fish-web-arch" reloadable= "true" source= "Org.eclipse.jst.j2ee.server: Fish-web-arch "/>

Therefore, if you deploy to the WebApps directory using MAVEN-combined Tomcat plug-ins, you will get an error


[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (DEFAULT-CLI) on project Fish-web-arch: Cannot invoke Tomcat Manager:fail-context/fish-web-arch is defined in Server.xml and may isn't undeployed

[ERROR] Fail-application already exists at Path/fish-web-arch


All you need to do is delete the server.xml in order to execute the MVN packaging command, such as:

Tomcat 6:mvn-dmaven.test.skip=true Tomcat7:redeploy

Tomcat 7:mvn-dmaven.test.skip=true Tomcat:redeploy



This article from "Small Fish Blog" blog, declined reprint!

Integrated Tomcat in Eclipse

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.