0

I am trying to debug the flow of the application. So in the process, I need to debug two applications running on two different tomcat servers(where a method in one application calls another method of different application). How can I achieve this in eclipse(is it possible)?

Note: Both the applications are in the same eclipse instance and does not have any debug configuration.

Brooklyn99
  • 987
  • 13
  • 24
  • 1
    I'm sure I must be missing something (sorry if this seems like a stupid question) but if they're both being run up locally in Eclipse, can't you just start them both in debug mode and put breakpoints in? – Robert Bain Sep 19 '19 at 22:55
  • 1
    @RobertBain, Santos said it has them running in separate Tomcat instances, which makes me think he doesn't have any run configuration for those projects in eclipse. – Lluís Suñol Sep 19 '19 at 23:09
  • 1
    Can't you do two remote debugging sessions at the same time in Eclipse? – Erwin Bolwidt Sep 19 '19 at 23:12

1 Answers1

1

You have to start both Tomcats with jpda (debug mode), with their corresponding different debugging port. In example: 8000 for the first Tomcat and 9000 for the second one (note that this port is not related to the http port, which in Tomcat usually is 8080) .

Then, on your eclipse you must set up two different debug configurations of type "Remote Application" pointing to the ports of each Tomcat (8000 and 9000). Start both debugging configurations ("attach" to the Tomcat process) and set your breakpoints in both projects.

As soon as you perform requests to any Tomcat, the execution should stop at any of your application breakpoints.

You are ready to start the execution of the flow you want to debug.

Lluís Suñol
  • 3,466
  • 3
  • 22
  • 33