eclipse_utils - sebabarre/wikiDoc GitHub Wiki

Utils

Table of Contents

Configurer eClipse pour remote Debug

Tomcat

  1. Configurer Tomcat If you are using shell scripts to start Tomcat, start it with the following command:

catalina jpda start

It will start Tomcat so that a remote debugger can be connected to port 8000. The above mentioned options can be provided by setting certain environment variables. See the comments at the top of catalina.sh or .bat file for details. For example, the port number and JPDA transport implementation can be set with JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket. If you run Tomcat using service wrapper, add the above JVM options before any other JVM options. Check the documentation for the service wrapper to determine how to set JVM options. If you start Tomcat from within an IDE, check the documentation for the IDE to determine how to set the required JVM options.

2. Configurer Eclipse Make sure that Tomcat is started in remote debugging mode as described above and that your app is deployed. Make sure that you have the sources for the code that you are trying to debug in your IDE. For the libraries and for Tomcat itself you can "attach" the sources to the jar files: open a class file and then click "Attach Source…​" button. If you have a servlet or something, set a breakpoint where it is sure to hit on the next request. Go to "Run→Debug Configurations…​". Click on "Remote Java Applications", then click "New". Type in the title. Note that port 8000 from the Tomcat instructions. Save and run. Eclipse will connect to the JVM that Tomcat is running under. Wow, that was easy!

⚠️ **GitHub.com Fallback** ⚠️