When debugging I set a breakpoint to a line that calls a method from another (own) class. On step into
I get a Source not found
in the editor with the title MyClass$Proxy$_$$_WeldClientProxy.myMethod() line: not available
in the stacktrace.
I can step over those as long as I am back in the class with the breakpoint.
I have the same problem using Eclipse Kepler SR 1, Eclipse Juno SR 2 and JBoss AS 7.1.1 and 7.2.
Begin code stepping by selecting F10 or F11. Doing so allows you to quickly find the entry point of your app. You can then continue to press step commands to navigate through the code. Run to a specific location or function, for example, by setting a breakpoint and starting your app.
Press F5 until you reach the line of code where you selected Run to Cursor. This command is useful when you are editing code and want to quickly set a temporary breakpoint and start the debugger at the same time. You can use Run to Cursor in the Call Stack window while you are debugging.
That's a common problem with autogenerated code. You believe that an object of yours (let's call it A) invokes a method on another object of yours (let's call it B), but the framework has actually replaced your object B with a proxy B' whose class is autogenerated.
The proxy B' has the same interface as your original object B, and eventually forwards the invocation to B.
Autogenerated code will confuse the debugger, but if you click "step into" blindly -- without seeing the source code -- you should eventually reach your own code again. Needless to say that it's not convenient.
What you can do instead is to
That should stop into the method you are interested in. You should be able to see in the stack the autogenerate methods of the proxy that have been invoked.
Note: you might have similar problem even if you don't use any framework at all. Indeed, the java compiler (javac) already generates synthetic code sometimes, notably for anonymous classes, and bridge methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With