tuk
tuk

Reputation: 6872

Remote Debugging Tomcat 7 with Eclipse Mars on MacOS X

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:-

enter image description here

But on launching Eclipse in debug configuration I am getting the below error:-

Failed to connect to Remote VM. Connection Refused.

Environment

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

Answers (1)

tuk
tuk

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

Related Questions