4

This is one of those problems that drives you on the verge of sanity.

I am running Eclipse Java EE Indigo on Windows XP 32bit. I am trying to debug a gwt client-service application on tomcat 6. I am using JDK1.6.0_32

I am trying to debug the server side of my application. I set breakpoints, launch the client as a web application locally and then debug the service as a remote java application ( standard(socket attach) localhost, 8000, correct sources). I have verified that I am running the server with the correct debug settings ( dt_socket, 8000, catalina.bat jpda start)

the break points are not being hit. Nothing, na-da. Eclipse does not suspend the thread and the code continues past the break points. What makes this even more confusing is yesterday the breakpoints worked, without me changing anything and this morning they don't.

I've tried restarting, cleaning and refreshing. Googling the problem brought up most issues from 2009 with an older release of Java.

EDIT: Eclipse gives out the error "Unable to install breakpoint due to missing line numbers" even though that option is selected in properties

Jabda
  • 1,752
  • 5
  • 26
  • 54
  • 1
    1.) Did you compile the server side classes with debug symbols (option `-g`) Here's [how to check](http://stackoverflow.com/questions/3145826/check-if-java-bytecode-contains-debug-symbols)? 2.) Another thing that's worth mentioning: In Eclipse, **method** breakpoints (as opposed to the usual line breakpoints) often simply don't work. I don't know why, it's probably a bug in Eclipse. – Chris Lercher Aug 27 '12 at 20:56
  • 1
    when launching the server in debug mode it says "listening for transport dt_socket at address: 8000" – Jabda Aug 27 '12 at 21:03
  • @Chris Lercher is there a way to check the debug symbols through Eclipse? They are line break points – Jabda Aug 27 '12 at 21:06
  • Before going nuts, what have you changed since it was working ? Did you tried a simple breakpoint into the first line of the `onModuleLoad` method ? – Jean-Michel Garcia Aug 27 '12 at 21:09
  • I am trying to debug the service, not the client, by attaching it.. onModuleLoad is part of the client code – Jabda Aug 27 '12 at 21:15
  • What am I looking for in the javap -v output? – Jabda Aug 27 '12 at 21:57
  • You may check this then http://stackoverflow.com/questions/957822/eclipse-unable-to-install-breakpoint-due-to-missing-line-number-attributes – Jean-Michel Garcia Aug 28 '12 at 08:06

3 Answers3

2

Since the service side of the code was built with an ant build. I had to ensure the .xml file was set to debug = "true". I still got the error message about missing lines, but the breakpoints worked.

Jabda
  • 1,752
  • 5
  • 26
  • 54
1

If you try to access the machine with telnet, does it respond?

telnet localhost 8000

The port may be blocked on firewall.

Jiri Kremser
  • 12,471
  • 7
  • 45
  • 72
  • If I try that before launching the debug server I get "Connecting To localhost...Could not open connection to the host, on port 8000: C onnect failed" If I try after the debug has been launched I get "Debugger failed to attach: timeout during handshake". – Jabda Aug 27 '12 at 21:03
1

You might need to specify whether you want line numbers or not, see our javac task:

<javac encoding="utf-8"
       ...
       debug="true" debuglevel="lines,vars,source"
       ... >
       ...
</javac>
n0rm1e
  • 3,796
  • 2
  • 28
  • 37