How to step into tomcat source?
You can debug Tomcat as a remote Java application.
Here is the steps:
- Create a Java project and copy Tomcat source files into project's source folder. (You can ignore compile errors.)
- Open Bootstrap.java and set a breakpoint at main method.
Create a CATALINA_BASE/bin/setenv.bat(or .sh) file and put following line into the file.
set JPDA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
Start the Tomcat in debug mode using catalina.bat (or .sh) from command line.
catalina.bat jpda start
From Eclipse, set up a Debug Configuration under Remote Java Application and connect to the Tomcat process. (Run -> Debug Configurations -> Remote Java Application.)
Screenshot: