7

So a couple weeks ago my Eclipse IDE no longer allowed me to remotely debug my application saying that it was unable to install breakpoints because line numbers were not being displayed...The problem is that my Eclipse is set up to display line numbers (which I use regularly in my day to day development)

I did some research and found that it sometimes has to do with using ant to build projects and a debug setting in javac. I made sure that the debugging is set in my build.xml target but it still won't let me debug with the same error.

And now, to add insult to injury, I clicked the box that says 'Do Not Show This Message Again' so now I'll never know if I'm actually debugging my program when I try or if it failed and the error message just didn't show up.

Does anyone know how to fix this? Or, at the very least know how to toggle that error message to pop back up so I can tell if/when I do fix it?

Saggio
  • 2,212
  • 6
  • 33
  • 50

5 Answers5

13

In order to re enable the message : Preferences => java => debug . it is at the bottom of the screen : "Warn when unable to install breakpoint du to missing line number attributes"

For the problem about installing breakpoints, try to add a -g to your javac command line in ant (debug attribute of you compilation task, http://ant.apache.org/manual/Tasks/javac.html)

Eventually check if you have not mapped your project on a JRE instead of a JDK in eclipse.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
Twister
  • 749
  • 4
  • 9
  • Do not forget to set debuglevel to lines,vars,source. If it does not work send us your ant file. – Twister Jan 21 '11 at 16:17
  • Thanks! It seems that it must be an issue with just one of my projects as I toggled the error message again and tried debugging another part of the program and it had no problems installing the breakpoints. – Saggio Jan 21 '11 at 16:26
10

This error might also be generated if your Eclipse workspace simply has some invalid (stale or corrupted) breakpoints set. In the Breakpoints view, look for breakpoints that might be set in classes that were moved or deleted, and delete them.

jondissed
  • 101
  • 1
  • 2
  • This would definitely explain why some of the projects in my solution throw the error yet others do not; I'll definitely take a look into this because I know there are quite a lot of old breakpoints that are disabled. Thanks! – Saggio Oct 16 '13 at 17:16
  • Should have been obvious that this was the problem, but other answers made me try all kinds of weird things that didn't work. Thanks! – halfpad Feb 07 '18 at 13:12
2

The error can be caused by the source code you have in Eclipse not matching the code used to build the application you are remotely debugging. Try rebuilding and rerunning the app and refreshing the source in Eclipse.

Roger
  • 21
  • 1
2

I think you may want to try adding -g to the compilearg in your ant build.

<javac sourcepath="" srcdir="${src}" destdir="${build}"
       classpath="xyz.jar" debug="on">
    <compilerarg value="-g"/>
</javac>

Also if you are unsure if break points are working just put a break point in an early point in your code that you know is getting executed. you can also add a print statement to ensure that the break point is being passed by.

richs
  • 4,699
  • 10
  • 43
  • 56
0

I ran into the same problem and @jondissed and @twister answers didnt help and I'm not using a custom ant task so I tried:

  • Close the WAR, EJB and EAR projects - reopen them - still error on deploy
  • Close eclipse - reopen, restart local JBoss server - still error on deploy
  • Close eclipse - reopen, restart local JBoss server - clean JBoss temp/data directories - still error on deploy
  • Undeploy app - remove breakpoints, re-add them redeploy - still an error on deploy

What finally worked for me was

  • Undeploy the app. Remove the breakpoints. Deploy the app. Re-add the breakpoint.

Debug now halts at breakpoint.

Update 1 - apparently Eclipse just gets angry at times as I just fought with it for about 10 minutes when the above appeared to not be working and while it popped the error, I closed it and it still stopped at the new, single breakpoint :-/

Update 2 - ran into the issue again, Eclipse is just being pissy about it and even update 1 doesn't fix it - it's also affecting modified code not being deployed so when Eclipse gets in it's "mood", a clean and build then full deploy of the project works O_o

JGlass
  • 1,427
  • 2
  • 12
  • 26