1

I try to debug openAdaptor:

in org.openadaptor.bootstrap.ClasspathBootstrapper:

mainMethod.invoke(appClass, new Object[] { args }); 

I found that this is main method of SpringAdaptor.

But Eclipse didn't stop on breakpoint! What can be the reason? Thanks.

6
  • Are you sure that your debugger is attached to the application you run. Need screenshots and/or more information to help you further. Commented Dec 21, 2011 at 19:06
  • Not enough information to go on. Are you debugging it, or running it? Commented Dec 21, 2011 at 19:06
  • Yes, I have attached source to application. In debug mode. Commented Dec 21, 2011 at 19:08
  • What version of the source code do you have configured in your debugger? Is it the same version as the bytecode you are attempting to debug? Commented Dec 21, 2011 at 19:08
  • Last version that I found. I think that this is because there many static methods. Are there any issues about static methods for debugging? Commented Dec 21, 2011 at 19:10

4 Answers 4

4

Make sure you haven't clicked on the little icon on top of Breakpoints tab in Debugger section. it will skip all breakpoints as you can see on its Tooltip.

Sign up to request clarification or add additional context in comments.

Comments

2

It's possible that the method is never called. Try moving your breakpoint right before where you think the method is called (or where you are 100% certain that it will be executed) and then go step by step and see if the method is called at all.

Comments

2

Eclipse is not super smart about line numbers with the breakpoints. It just says "The line in this source file is X, stop there". If there is some post processing that changes the line numbers (like for certain code coverage tools), the breakpoint will be in the wrong place.

Also, you say you have attached the source, but be sure you have really done that. Just having the source in the project or in the workspace is not enough. If it's a project, you need to be sure your project has a dependency on that project and not a jar file. If it's a jar, you need to make sure the association with the source is correct (just being on the classpath is not enough).

Finally, you need to be sure you are really executing what you think you are executing. I have set a lot of breakpoints, and then wondered why they weren't being called. The reason ended up being that the program flow was the not the same that I thought it was.

Comments

1

Confirm that rather than running your app:

enter image description here

Make sure you're using the debugger:

enter image description here

Breakpoints are ignored unless your running your app with the debugger.

If that's not the issue, then make sure that your method is actually being called. Try putting breakpoints in other places in your application (in code that you're 100% is being called) and see what happens.

It shouldn't make any difference what the method signature is (static or otherwise). Sometimes breakpoints break after the line you think they will break on. Try moving your breakpoint up by one line, and see if that's the issue.

You can also try stepping through the app to see if the code you think is running, actually isn't being called at all. If that's not an option, check for any assumptions you might be making (e.g. is the breakpoint on a line inside of a if statement - are you sure your if statement is evaluating the way you expect)?

1 Comment

I did, and I updated my answer. Your comments weren't originally there when I started writing the answer, so I just took the first thing that I thought might be wrong is all. I see your comments about the debugger, and I've added several other options. The most likely cause (if breakpoints are working elsewhere in your code) is that you think that line is being executed, but it actually isn't for some reason. It should just be a matter of figuring out why.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.