Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Remote Debug Tomcat in Eclipse

leave a comment »

Remote debugging is a must for web-applications. When a .war file is deployed in a web/jee container, we have no way to track where / how the application runs besides doing on screen (or file) prompts. But this is not an effective way; and REMOTE DEBUGGING is the key to overcome this mountain.

To do remote debug of tomcat via Eclipse, is simple and effective. You just have to takes some times to setting up your environment once, and you can benefits from it in later days.

Step 1: Edit catalina.out /
Add in the string in the catalina.out
set JPDA_TRANSPORT=dt_socket

This action is to add port in your tomcat when it starts, and the port number defined here is “8787” (This is the default debug port for tomcat)

Step 2: Add “Remote Java Application” in Eclipse’s Debug

Remember to set the port number as the 1 you set in Step#1 and hits “Debug” button
p/s: pls set your break-points before you do this remote debug configuration

Step 3: Starts Tomcat
Go to "../tomcat/bin", hits “cataline.out jdpa start
Yeah, the remote debug is started, you can see your bug clearly now!

Source: Tomcat FAQ

Written by Alfred

April 24, 2008 at 15:45

Posted in Eclipse, Java, tomcat

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: