Running Tomcat source in eclipse

Source: Internet
Author: User

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

Note: If you download a different version of Tomcat, you are using a different version of the JDK. 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;

4. conf, Java, test three folders as the source folder.

Right-click on these three directories-->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 the 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


Project structure such as:



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

Attention:

When running Tomcat source code, if you encounter java.lang.ClassNotFoundException:listeners. Contextlistener error, delete the examples directory under WebApps.





Reference files:

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

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




Running Tomcat source 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.