Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Eclipse debug code in an application server?

What communication is going on between Eclipse and my application server (JBoss) when I run the server from within Eclipse in debugging mode? How does this work?

like image 456
skiphoppy Avatar asked Dec 05 '08 14:12

skiphoppy


People also ask

How do I debug a server in Eclipse?

Enabling remote debuggingSelect Run → Debug Configurations…. The Debug Configurations dialog box is displayed. Select Remote Java Applications. Select New launch configuration as illustrated in Remote Java application's debug configuration.

How does debug work in Eclipse?

A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.

How do you connect to and debug a remote Java application server in Eclipse?

4) In Eclipse, from the Run menu, click Debug and create a new 'Remote Java Application'. 5) Select your project, enter 9091 for the connection port number and click Debug. Eclipse should now switch you to the Debug perspective which shows you running threads, breakpoints, variables and your source code.


1 Answers

When you start the server in debug mode, it listens on a specified TCP port. Eclipse connects to that port, and they talk using the Java Debug Wire Protocol (JDWP). Read the details here: http://java.sun.com/j2se/1.5.0/docs/guide/jpda/

like image 61
Michael Borgwardt Avatar answered Sep 22 '22 17:09

Michael Borgwardt