Steps to start Tomcat in Debug mode
Here is the steps you have to follow for starting Apache tomcat in debug mode
Step 1 :
Go to your bin tomcat bin folder . Path will be something like the following
C:\apache-tomcat-7.0.27\bin
Create a file with the following contents and save as “setenv.bat”
set JPDA_ADDRESS=7777
set JPDA_TRANSPORT=dt_socket
Here tomcat will start up and it will open debug port 7777.
Step 2 :
Now you go to command prompt and type the following command to start the tomcat in debug mode
Apache tomcat will start in the debug mode.
Another way to replace step 2
Create a .bat file which has the below contents
catalina.bat jpda start
In this case you can start Tomcat by just clicking on the created bat file .
Now you can open your IDE and configure Remote Debug on your host
Configuring remote debug in eclipse
Click on the Debug icon >> Open Debug Dialog
On click of Open Debug Dialog you will get a dialog box for doing the configuration
Mention the following
Project Name – You can mention any name
Host : You can give localhost if the Apache tomcat server is running locally.
Port : You have to mention the debug port on which Tomcat server running, In our example we have configured 7777.
Now it is possible to catch breakpoints once you run the application.
Leave a Reply