Tomcat Source Import Eclipse step

Source: Internet
Author: User
Tags wsdl

1. Get the source code

Mode one: from the official website http://tomcat.apache.org/download-70.cgi direct download, the official website provides binary and source code two download method, to study the tomcat source code, choose source Codes method download

Mode two: Use SVN to get the source code, first install SVN, then create a new directory TOMCAT7, and then execute the following command in the directory

[Java]View Plaincopy
    1. SVN Co http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/tomcat_7_0_35/./

Tags directory has a different version of the Tomcat source code, the download version here is 7.0.35


2. Importing the source code into Eclipse Tomcat is created and managed using Ant. After you install Ant and then execute Ant ide-eclipse, the command executes successfully and is produced in the TOMCAT7 directory. Project and. Classpath two files, which became Eclipse Engineering.     This allows you to import the Tomcat source into eclipse. Execute Ant ide-eclipse times wrong: [Java]View Plaincopy
    1. BUILD FAILED build.xml:2361:the following error occurred while executing this line:
    2. BUILD FAILED build.xml:2449:compile FAILED; see the compiler error output for details.
To view the compiled error log: [Java]View Plaincopy
  1. BUILD-TOMCAT-DBCP:
  2. [Copy] Copying files to E:\usr\share\java\tomcat7-deps\dbcp
  3. [Move] Moving files to E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp
  4. [Javac] Compiling source files to E:\usr\share\java\tomcat7-deps\dbcp\classes
  5. [Javac] Warning: [Options] Bootstrap class path not set in conjunction with-source 1.6
  6. [Javac]  E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\BasicDataSource.java:53:error:bas
  7. Icdatasource is isn't abstract and does not override abstract method Getparentlogger () in Commondatasource
  8. [Javac] public class Basicdatasource implements DataSource {
  9. [Javac] ^
  10. [Javac] E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\DelegatingStatement.java:46:error :  
  11. Delegatingstatement is isn't abstract and does not override abstract method Iscloseoncompletion () in Statement
  12. [Javac] public class Delegatingstatement extends Abandonedtrace implements Statement {
  13. [Javac] ^
  14. [Javac] E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp\dbcp\DelegatingPreparedStatement.java: $
  15. : Error:delegatingpreparedstatement is not abstract and does not override abstract method Iscloseoncompletion () I n Stat
  16. Ement
Depending on the log error, the dependent DBCP related jar version is incorrect. The native version of the JDK is 1.7, so a 1.6 jdk is installed on the machine, and the relevant environment variables are modified so that java_home points to the JDK 1.6 directory. Execute the ant ide-eclipse again and get the BUILD successful
Total Time:2 minutes seconds
Also note that the build log for BUILD-TOMCAT-DBCP is updated to: [Java]View Plaincopy
  1. BUILD-TOMCAT-DBCP:
  2. [Copy] Copying files to E:\usr\share\java\tomcat7-deps\dbcp
  3. [Move] Moving files to E:\usr\share\java\tomcat7-deps\dbcp\src\java\org\apache\tomcat\dbcp
  4. [Javac] Compiling source files to E:\usr\share\java\tomcat7-deps\dbcp\classes
  5. [Javac] Note: Some input files use or overwrite outdated APIs.
  6. [Javac] Note: To learn more, recompile with-xlint:deprecation.
  7. [Javac] Note: Some input files use an unchecked or unsafe operation.
  8. [Javac] Note: To learn more, recompile with-xlint:unchecked.
  9. [Jar] Building Jar:e:\usr\share\java\tomcat7-deps\dbcp\tomcat-dbcp.jar
  10. [Jar] Building Jar:e:\usr\share\java\tomcat7-deps\dbcp\tomcat-dbcp-src.jar
Therefore, the problem can be summarized as follows: Tomcat source relies on JDK version 1.6 and below, using jdk1.7 will cause build failure. 3. Add the jar package in build path, solve the compilation problem after importing Eclipse, you will find that the project TOMCAT7 has a red exclamation point, because the dependent jar package is not added to the build path resulting in a compilation error.    Refer to the third step in the blog http://jackycheng2007.iteye.com/blog/1477845. Another problem encountered, the Org.apache.naming.factory.webservices package of two classes serviceproxy,servicereffactory still wrong, unrecognized [Java]View Plaincopy
    1. import javax.xml.rpc.service;   
    2. IMPORT JAVAX.XML.RPC.SERVICEEXCEPTION;  
    3. import javax.wsdl.definition;  
    4. import javax.wsdl.port;  
    5. import javax.wsdl.extensions.soap.soapaddress;  
    6. IMPORT JAVAX.WSDL.FACTORY.WSDLFACTORY;  
    7. import javax.wsdl.xml.wsdlreader;  
These classes. The machine is still missing jar package, Baidu found the lack of a Web service development Kit Axis-bin-1_4.zip.     After downloading, add to build path to resolve. Aside from: Ant does not have maven handy, maven can manage dependent jars and automatically downloads dependencies from the Maven repository without having to manually download the jar and add the build path
4. Run the fourth step in the reference blog http://jackycheng2007.iteye.com/blog/1477845

Tomcat Source Import Eclipse step

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.