Execute Tomcat source code in eclipse

Source: Internet
Author: User

1. To http://archive.apache.org/dist/tomcat/tomcat-7 download Tomcat source code, this article uses is apache-tomcat-7.0.19-src.zip;

Note: If you download a different version of Tomcat, the version number of the JDK you are using is different. For example apache-tomcat-7.0.19-src.zip use jdk1.6 no problem;

And apache-tomcat-7.0.56 can not be used jdk1.6 need to use jdk1.7, if the use of jdk1.6 code will error, will not find some classes under Java.nio.

2. Create a new Java Project in Eclipse. Named Tomcat7109 (optional).

3. Import all the files from the source code to the newly created project, click the project-right menu->import .... file system->.

4. Use the Conf, Java, test three directories as the source folder.

Right-click on these three folders-->build Path-->use as Source folder;

5. Compile at this time, will error, need to add some necessary jar package.

The required jar packages are:

Ant.jar

Geronimo-spec-jaxrpc-1.1-rc4.jar

Hamcrest-core-1.3.jar

Junit-4.11.jar

Wsdl4j-1.6.2.jar

How to get the jar package:

(1) Download online.

Find out for yourself.

(2) Download the jar package yourself according to Build.properties.default in the source code.

Download Geronimo-spec-jaxrpc-1.1-rc4.jar as An example: Open build.properties.default

Find #---- -Webservices-jax RPC-----
JAXRPC-LIB.VERSION=1.1-RC4
jaxrpc-lib.home=${base.path}/jaxrpc-${jaxrpc-lib.version}
jaxrpc-lib.loc=${base-maven.loc}/geronimo-spec/geronimo-spec-jaxrpc/${ Jaxrpc-lib.version}/geronimo- Spec-jaxrpc-${jaxrpc-lib.version}.jar
Span style= "White-space:pre" > jaxrpc-lib.jar=${jaxrpc-lib.home}/geronimo-spec-jaxrpc-${jaxrpc-lib.version }.jar

Send the address to connect. Base-maven.loc=http://repo.maven.apache.org/maven2


The project structure is for example:



Find the Org.apache.catalina.startup.Bootstrap class and execute it to start Tomcat.

Attention:

When executing the Tomcat source code, assume that Java.lang.ClassNotFoundException:listeners is encountered. Contextlistener error, delete WebApps under the examples folder is available.





Documentation:

http://blog.csdn.net/fwwdn/article/details/8773001

http://my.oschina.net/xpbug/blog/53610




Execute Tomcat source code in eclipse

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.