0

On applying breakpoints to a java file in debug mode, the breakpoints are not stopping the control flow of that file. However, the breakpoints are stopping the control flow on another file in the same package. When i apply breakpoints on one file the break point changes to a circle with tail and the break point stops the control flow while on applying it to other file it remains a circle only and does not stop the control flow. How to get the break point to stop the control flow?

Working: enter image description here

Not working: enter image description here

Farrukh Chishti
  • 7,652
  • 10
  • 36
  • 60
  • 1
    can you post an image of those circles? – sanbhat May 23 '13 at 05:31
  • 3
    Are you sure that the code that isn't stopping on the breakpoint is being executed? Try adding a `System.out.println("Test");` to see if it is even executing. Also if you post the code, we will be able to help more, try a [SSCCE](http://sscce.org/) – Craig May 23 '13 at 05:31
  • @Craig: I am sure the code is executing as it is printing all the loggers that i have added to the code. Only the breakpoints are not working properly. – Farrukh Chishti May 23 '13 at 05:39
  • 1
    Are you doing remote application debuggin? I mean whether it's a desktop app or a webapp – Juned Ahsan May 23 '13 at 05:43
  • 1
    Looks like.. check second answer for http://stackoverflow.com/questions/4079000/what-different-breakpoint-annotations-mean-in-eclipse – sanbhat May 23 '13 at 05:43
  • @JunedAhsan: remote app debuging. And somebody just came with a wild idea of restarting my system. – Farrukh Chishti May 23 '13 at 05:44
  • Have a look at http://stackoverflow.com/questions/1799362/what-does-it-mean-for-a-breakpoint-to-be-installed#answer-1799468, it has a good summary of the eclipse breakpoints – Craig May 23 '13 at 05:44
  • @sanbhat : The second answer matched my situation. But i can't get this part " once the JPDA agent in the remote system has been told about it, and has confirmed it's set, then it gets a tick" – Farrukh Chishti May 23 '13 at 05:47
  • Take the secretary solution (no offence), restart your Eclipse, if the problem still there, restart your computer... sh** happens! – gran33 May 23 '13 at 12:43

3 Answers3

2

Ok as you have mentioned as a reply to my comment that you are doing remote appliction debugging. So most likely the problem is that you have different version of code in your server and in your eclipse.

In short it seems that executable doesn't map their source lines all that well to the generated .java file source lines. So what looks like a source line in your real source isn't actually executable in the generated source, so it can't actually sustain a breakpoint.

Hope it helps!

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
  • sounds logical. How to ensure its the same code or different? – Farrukh Chishti May 23 '13 at 05:49
  • @qualtar Make sure you deploy the current war/ear on your server. Or you can do some reverse engineering by using a java decompiler. Take the class file from your server decompile it and compare it with your source code. Although decompiled file may not be exactly similar to your source file but you still may be able to get value out of it. – Juned Ahsan May 23 '13 at 06:16
0

Please guarantee that your code and server are hold consistent, will otherwise have this question.

0

Circle with tail : Breakpoint is successfully set because Your Source code matches with the Byte Code and debug control will reach there.

Only Circle : Source code differs from Byte code (May be you are running a older Snapshot of code). Control will never reach at this breakpoint. You will have to update your JARs to get control to these breakpoints.

Solution : In case of remote debugging this happens often, you can get your problem solved by replacing older JARs with new ones obtained after building your project.

rdj7
  • 1,905
  • 4
  • 18
  • 33