- This topic has 0 replies, 1 voice, and was last updated 18 years, 2 months ago by Riyad Kalla.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
Riyad KallaMemberThis question is meant to help people that, while debugging, may want to actually step into the Tomcat source files like the Catalina request processors or something along those lines. Long time MyEclipse guru arjan.tijms has posted very detailed steps on how to get this working (for Tomcat 5; later releases may be slightly different) and they are as follows:
- Download tomcat sources and extract
- The actual source is spread throughout many different directories, collect them all into a single directory (you’ll end up with a javax.servlet.* and an org.apache.*; if you do this often you may wish to create a script for doing this)
- Create a new web project and copy the merged tomcat sources to it
You’ll notice a lot of unmet dependencies. This doesn’t matter as JDT is still able to do its work. If you wish you can satisfy these dependencies by copying libs like commons-collections, commons-logigng etc to this project’s path. - JAR both the sources and compiled classes. In my project I have an ant file in a directory tomcat5.5.17/build_libs, where tomcat5.5.17 is the name of my project. E.g.
<project name="tomcat" default="doTomcat" basedir="../." > <property name="buildDir" value="build_libs" /> <property name="binSourceDir" value="WebRoot/WEB-INF/classes/" /> <property name="srcSourceDir" value="src/" /> <target name="doTomcat" > <jar destfile="${buildDir}/tomcat_5_5_17.jar" basedir="${binSourceDir}" includes="javax/servlet/** org/apache/**" > </jar> <jar destfile="${buildDir}/tomcat_5_5_17_src.jar" basedir="${srcSourceDir}" includes="javax/servlet/** org/apache/**" > </jar> <eclipse.refreshLocal resource="tomcat5.5.17/${buildDir}" depth="infinite"/> </target> </project>
- In the project where you wish to step into tomcat’s source code, create a directory -outside- of your web root, e.g. [project root]/ext_src (it must be created outside the web root so it doesn’t get deployed).
- Copy the tomcat_5_5_17.jar and tomcat_5_5_17_src.jar to this new directory.
- In your project settings, add ext_src/tomcat_5_5_17.jar to your Java build path.
- While the Java build path dialog is still open, unfold the jar you just added and do a source attachment to the tomcat_5_5_17_src.jar.
- You may wish to close the other project where you generated the jars.
You can now step into the majority of the tomcat source code from your own code. For a few classes the MyEclipse J2EE library container still takes precedence when debugging, notably javax.servlet.jar. Sometimes it helps to attach the tomcat_5_5_17_src.jar to this.
- This topic was modified 9 years, 5 months ago by support-tony. Reason: Corrected markup
-
AuthorPosts
Viewing 1 post (of 1 total)