Reputation: 6872
I am trying to set-up remote debugging tomcat with Eclipse. As mentioned in this answer. I have added the below lines in my startup.sh
at the very start (so that Tomcat always starts in debug mode).
########## Starting Tomcat in Debug mode always #############
JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
catalina.sh jpda start
#############################################################
In Eclipse I have made the below debug configuration:-
But on launching Eclipse in debug configuration I am getting the below error:-
Failed to connect to Remote VM. Connection Refused.
Environment
Tomcat - 7.0.75
Eclipse - Version: Mars.2 Release (4.5.2)
OS - El Capitan Version 10.11.6 (15G1212)
Java - 1.8.0_77
I have also checked that port 8000 is free by executing the below command:-
tuk-MacBook-Pro-4:bin tuk$ lsof -n -i -a | grep "8000"
tuk-MacBook-Pro-4:bin tuk$
Tried with a different port, 12345
but getting same error.
Can someone let me know what I am doing wrong and how can I do a remote debugging using eclipse with Tomcat 7?
Upvotes: 0
Views: 2449
Reputation: 6872
In my case just doing catalina.sh jpda start
(I did not have to set JPDA_OPTS
.) and checking Allow termination of Remote VM
under Debug Configuations
-> Remote Java Application
in eclipse solved the issue.
Upvotes: 1