Debug Tomcat6 Source under Eclipse

Source: Internet
Author: User

Original address: http://denger.iteye.com/blog/834121

Recently, some of the mechanism of Tomcat has attracted interest, so download the source code to DEBUG to find out ~
Tomcat_6_0_18.zip Bag: Http://pan.baidu.com/s/1mgGcPug
Download the extracted directory structure:

It's obviously built on ANT, directly through

Java Project form Existing Ant buildfile, Eclipse, New, directly selects the build.xml file below tomcat_6_0_18,

Then the target in the listed task selects complie to import the project.


Not yet finished, his compilation also relies on four jar files, respectively:

Ant.jar, Jaxrpc.jar, Org.eclipse.jdt.core_3.8.3.v20130121-145325.jar, Wsdl4j-1.5.1.jar, these four jar files need to be brought in.
OK, next, add a appliction that launches Tomcat directly in the Debug configurations in eclipse.

Specifically, add the main startup item to Java application and select the Tomcat 6.0 project ( actual name Bootstrap) that you just imported.

Main class fills in the org.apache.catalina.startup.Bootstrap startup class,

Arguments:

In program arguments fill in start ,

In VM arguments, fill in the path to the Tomcat home ( source path ), such as:-dcatalina.home= "E:\tomcat-src\TOMCAT_6_0_18".

As shown in the following:





After configuration, direct Apply and Debug, this time the direct start will appear the following exception:--- This paragraph I did not test

Java code
    1. Java.lang.ClassNotFoundException:listeners. Contextlistener
    2. At Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1645)
    3. At Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1491)


The reason is that there is a example webapp in Tomcat in WebApps, which is configured with the listeners in the app's Web. Xml. Contextlistener, and this class does not exist in its classpath. The solution is to remove the example directly, but it does not affect debug anyway.

Now that the TOMCAT deployment has been completed, the next step is to start the debug ....

Debugging Tomcat6 Source (go) under 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.