3

have two machines -windows and linux present locally. I am trying to run remote debugging (using eclipse) on windows machine to a tomcat application on linux box(fedora). I have enabled a debugging port 8800 on linux box and the startup log says “listening for transport dta_socket at 8800” Now when I try to connect my eclipse to it, I get “Failed to connect to remote VM. Connection refused.”

Here is the port description on linux

lsof -i:8800

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

java 21930 root 4u IPv4 59436 0t0 TCP *:sunwebadmin (LISTEN)

netstat -tulpn

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:8800 0.0.0.0:* LISTEN 21930/java

when i hit the url http://{linux-ip}:8800 from either machine, Tomcat logs says Debugger failed to attach : Handshake failed

Obviously the port is not accessible hence the debugger is not able to connect. Please suggest, what steps to follow. Any pointers would be helpful too.

4
  • 1
    This looks like a job for Serverfault to me. Jul 17, 2009 at 15:13
  • I'd say that debugging is still programming related
    – Draemon
    Jul 17, 2009 at 15:51
  • 1
    If I were scratching my arse when trying to connect, that wouldn't make the question arse-related, would it?
    – skaffman
    Jul 17, 2009 at 15:53
  • 1
    @skaffman try arseoverflow.com
    – Inshalla
    Jul 17, 2009 at 16:24

5 Answers 5

4

My guess is it's a firewall issue. To diagnose, either switch to root or use sudo to execute these commands described below:

Firstly, service iptables status will show you your current rules. Depending on how esoteric your firewall rules are, you may need to add them into the main question to debug but essentially you're looking for a line that accepts TCP port 8800 prior to a line that rejects all connections.

e.g.

Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source       destination
...
14   ACCEPT     tcp  --  0.0.0.0/0    0.0.0.0/0      state NEW tcp dpt:8800
15   REJECT     all  --  0.0.0.0/0    0.0.0.0/0      reject-with icmp-host-prohibited

If you don't have a REJECT line on your input chain, then the firewall is probably already turned off.

One way to get around this is obviously to turn off the firewall (service iptables stop) although this defeats the entire purpose of having a firewall.

If you need to add a new firewall rule, you have a couple of options:

  1. Use the excellent Firewall Configuration tool (system-config-firewall) that ships with Fedora and can be found at the System->Administration->Firewall menu item in Gnome.

  2. On the command line, insert a new rule before the REJECT rule by executing the following (uses numbers from my example above): iptables -I INPUT 15 -m state --state NEW -m tcp -p tcp --dport 8800 -j ACCEPT. NOTE that these changes are not permanent and will not persist beyond the next reboot.

  3. Manually edit the /etc/sysconfig/iptables file and add a rule (-A INPUT -m state --state NEW -m tcp -p tcp --dport 8800 -j ACCEPT) to the firewall prior to the REJECT rule. Cycle the firewall service to pick up the changes via a service iptables restart. These changes will be applied every time the firewall service is started.

3

Chances are you've installed the default firewall rules on Fedora.

run /etc/init.d/iptables stop

To check if that's the issue

2

Start with some basic network troubleshooting. Try telnetting to the port to see if it's really open

telnet IP 8800

Would give you

Trying IP.ADD.RE.SS...
Connected to IP.ADD.RE.SS.
Escape character is '^]'.

And if there is a firewall in between that REJECTS packets.

Trying IP.ADD.RE.SS...
telnet: connect to address IP.ADD.RE.SS: Connection refused

If the firewall DROPs the packets, you would get a timeout.

0

A few points:

  • The output of the server log and those commands means the port is open and tomcat is listening.
  • You're trying to connect to 8800 over http - I doubt the debugging protocol is http, but I don't know.
  • You're getting messages in the tomcat log on attempted connections - indicating that at the TCP level everything's fine, but "handshaking" is failing.
0

Thanks guys for all the inputs..and sorry for replying so late but the real fault was with the LINUX machine. It was not registerd in the DNS that my organisation uses. So the machine was not accessible using the hostname and only by IP(dynamic).

And along with i had made the rule changes as given by Ophidian. Then it worked for me.

Thanks again all, your inputs helped me reach the issue.

You must log in to answer this question.