Home » Newcomers » Newcomers » Infamous Source Not Found message debugging(Can no longer step into java files within the same project)
| |
Re: Infamous Source Not Found message debugging [message #1015439 is a reply to message #1015292] |
Thu, 28 February 2013 15:12 |
|
On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
> I've been using Eclipse for a month or so without problems but recently
> debugging Java projects no longer works correctly.
>
> I have a single Java project in my workspace.
> It has three Java files.
> I reference 2 external jar files.
> The programs work correctly, but when I try to debug things aren't
> working correctly.
>
>
> I set a breakpoint in one of the java files the debugger stops at the
> right place. When I try to step into code in another java file (F5) in
> the same project I get the "Source Not Found: message.
> The message window has the title -
> Launcher$AppClassLoader(ClassLoader).loadClass(String) line 356
> If I set a breakpoint in the other java file and instead step over (F6)
> the debugger open the other file and breaks stops at the right place!!
> I have tried to Edit Source Lookup Path to include Default and also to
> only include the project Source folder.
> [snip]
What David said explains is what's happening and his is the right answer.
To be very practical, however, I would add that, in this particular
case, you shouldn't seek to get code so that you can wander into and see
what's going on here because it's not interesting. Here's what I do:
1. Click the down arrow or press the function key to step into the class
I want to debug.
2. Find myself in the loader code (what's making you complain).
3. Click the yellow up arrow (or press the function key) to return out.
4. Continue at step #1.
What's in the loader code isn't interesting and this methodology I've
just given you will serve in other circumstances too such as loading
strings. When you find yourself in missing code, don't panic, just think
about why you got there and whether you can just step back out, then
step down again.
If you want to skip doing this because it's too much of a hassle, you can...
1. Just set a breakpoint down inside the code you want to go to and use
the resume (green arrow or function key) to get there (instead of
stepping); this by-passes what's making you complain here. Of course,
you actually have to know where execution will be going.
2. Write your code such that you don't make method calls or perform
menial actions (like string concatentation) in the argument list to
methods you wish to step down inside of. Later, when you're not so keen
to debug, you can restore your coded method calls to the way you usually
do it.
Hope this helps.
|
|
| |
Re: Infamous Source Not Found message debugging [message #1015756 is a reply to message #1015439] |
Sat, 02 March 2013 09:40 |
bhrgunatha deva Messages: 7 Registered: February 2013 |
Junior Member |
|
|
Russell Bateman wrote on Thu, 28 February 2013 10:12On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
> I've been using Eclipse for a month or so without problems but recently
> debugging Java projects no longer works correctly.
>
> I have a single Java project in my workspace.
> It has three Java files.
> I reference 2 external jar files.
> The programs work correctly, but when I try to debug things aren't
> working correctly.
>
>
> I set a breakpoint in one of the java files the debugger stops at the
> right place. When I try to step into code in another java file (F5) in
> the same project I get the "Source Not Found: message.
> The message window has the title -
> Launcher$AppClassLoader(ClassLoader).loadClass(String) line 356
> If I set a breakpoint in the other java file and instead step over (F6)
> the debugger open the other file and breaks stops at the right place!!
> I have tried to Edit Source Lookup Path to include Default and also to
> only include the project Source folder.
> [snip]
What David said explains is what's happening and his is the right answer.
To be very practical, however, I would add that, in this particular
case, you shouldn't seek to get code so that you can wander into and see
what's going on here because it's not interesting. Here's what I do:
1. Click the down arrow or press the function key to step into the class
I want to debug.
2. Find myself in the loader code (what's making you complain).
3. Click the yellow up arrow (or press the function key) to return out.
4. Continue at step #1.
What's in the loader code isn't interesting and this methodology I've
just given you will serve in other circumstances too such as loading
strings. When you find yourself in missing code, don't panic, just think
about why you got there and whether you can just step back out, then
step down again.
If you want to skip doing this because it's too much of a hassle, you can...
1. Just set a breakpoint down inside the code you want to go to and use
the resume (green arrow or function key) to get there (instead of
stepping); this by-passes what's making you complain here. Of course,
you actually have to know where execution will be going.
2. Write your code such that you don't make method calls or perform
menial actions (like string concatentation) in the argument list to
methods you wish to step down inside of. Later, when you're not so keen
to debug, you can restore your coded method calls to the way you usually
do it.
Hope this helps.
It does - all helpful information. Thanks. Seems I need to be more careful about using Step Into and setting breakpoints. It's strange because I'm sure that I was able to step into my own constructors without going into the platforms loader classes.
Still at least I know what's happening now.
|
|
|
Re: Infamous Source Not Found message debugging [message #1015779 is a reply to message #1015756] |
Sat, 02 March 2013 17:55 |
|
On 03/02/2013 02:40 AM, bhrgunatha deva wrote:
> Russell Bateman wrote on Thu, 28 February 2013 10:12
>> On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
>> > [snip]
> It does - all helpful information. Thanks. Seems I need to be more
> careful about using Step Into and setting breakpoints. It's strange
> because I'm sure that I was able to step into my own constructors
> without going into the platforms loader classes.
> Still at least I know what's happening now.
What's happening is that when you are able to step into your
constructors without the loader class getting called first it's because
your class has already been loaded for a reason that's opaque to you
some other class caused it to be loaded for a less than obvious reason
and so it was already there.
Remember that Java execution isn't a sequence of machine instructions as
it is when you're stepping through an application written in C/C++. It's
virtual machine instructions being interpreted by a very intelligent
interpreter, the JVM, that does things very efficiently, loading classes
on demand, garbage-collecting, etc., stuff that's not immediately
obvious until you think really hard about it. Thinking really hard about
it rather misses the point today when we're concerned with writing code
whose only goal is to accomplish something cool. We usually no longer
have to worry, as I had to 30+ years ago in my first job, about code
size, memory overlays, resident TEXT, page faults, etc.
Life's good now!
|
|
|
Re: Infamous Source Not Found message debugging [message #1015810 is a reply to message #1015779] |
Sun, 03 March 2013 07:02 |
bhrgunatha deva Messages: 7 Registered: February 2013 |
Junior Member |
|
|
Russell Bateman wrote on Sat, 02 March 2013 12:55On 03/02/2013 02:40 AM, bhrgunatha deva wrote:
> Russell Bateman wrote on Thu, 28 February 2013 10:12
>> On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
>> > [snip]
> It does - all helpful information. Thanks. Seems I need to be more
> careful about using Step Into and setting breakpoints. It's strange
> because I'm sure that I was able to step into my own constructors
> without going into the platforms loader classes.
> Still at least I know what's happening now.
What's happening is that when you are able to step into your
constructors without the loader class getting called first it's because
your class has already been loaded for a reason that's opaque to you
some other class caused it to be loaded for a less than obvious reason
and so it was already there.
Remember that Java execution isn't a sequence of machine instructions as
it is when you're stepping through an application written in C/C++. It's
virtual machine instructions being interpreted by a very intelligent
interpreter, the JVM, that does things very efficiently, loading classes
on demand, garbage-collecting, etc., stuff that's not immediately
obvious until you think really hard about it. Thinking really hard about
it rather misses the point today when we're concerned with writing code
whose only goal is to accomplish something cool. We usually no longer
have to worry, as I had to 30+ years ago in my first job, about code
size, memory overlays, resident TEXT, page faults, etc.
Life's good now!
Aha! That's what I was missing!
I'm still new to Eclipse so it's difficult to reason about what might cause these problems.
Thanks for your explanations.
|
|
|
Re: Infamous Source Not Found message debugging [message #1015814 is a reply to message #1015779] |
Sun, 03 March 2013 07:02 |
bhrgunatha deva Messages: 7 Registered: February 2013 |
Junior Member |
|
|
Russell Bateman wrote on Sat, 02 March 2013 12:55
> On 03/02/2013 02:40 AM, bhrgunatha deva wrote:
> > Russell Bateman wrote on Thu, 28 February 2013 10:12
> >> On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
> >> > [snip]
> > It does - all helpful information. Thanks. Seems I need to be more
> > careful about using Step Into and setting breakpoints. It's strange
> > because I'm sure that I was able to step into my own constructors
> > without going into the platforms loader classes.
> > Still at least I know what's happening now.
>
> What's happening is that when you are able to step into your
> constructors without the loader class getting called first it's because
> your class has already been loaded for a reason that's opaque to you
> some other class caused it to be loaded for a less than obvious reason
> and so it was already there.
>
> Remember that Java execution isn't a sequence of machine instructions as
> it is when you're stepping through an application written in C/C++. It's
> virtual machine instructions being interpreted by a very intelligent
> interpreter, the JVM, that does things very efficiently, loading classes
> on demand, garbage-collecting, etc., stuff that's not immediately
> obvious until you think really hard about it. Thinking really hard about
> it rather misses the point today when we're concerned with writing code
> whose only goal is to accomplish something cool. We usually no longer
> have to worry, as I had to 30+ years ago in my first job, about code
> size, memory overlays, resident TEXT, page faults, etc.
>
> Life's good now!
Aha! That's what I was missing!
I'm still new to Eclipse so it's difficult to reason about what might cause these problems.
Thanks for your explanations.
|
|
|
Re: Infamous Source Not Found message debugging [message #1015816 is a reply to message #1015779] |
Sun, 03 March 2013 07:02 |
bhrgunatha deva Messages: 7 Registered: February 2013 |
Junior Member |
|
|
Russell Bateman wrote on Sat, 02 March 2013 12:55
> On 03/02/2013 02:40 AM, bhrgunatha deva wrote:
> > Russell Bateman wrote on Thu, 28 February 2013 10:12
> >> On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
> >> > [snip]
> > It does - all helpful information. Thanks. Seems I need to be more
> > careful about using Step Into and setting breakpoints. It's strange
> > because I'm sure that I was able to step into my own constructors
> > without going into the platforms loader classes.
> > Still at least I know what's happening now.
>
> What's happening is that when you are able to step into your
> constructors without the loader class getting called first it's because
> your class has already been loaded for a reason that's opaque to you
> some other class caused it to be loaded for a less than obvious reason
> and so it was already there.
>
> Remember that Java execution isn't a sequence of machine instructions as
> it is when you're stepping through an application written in C/C++. It's
> virtual machine instructions being interpreted by a very intelligent
> interpreter, the JVM, that does things very efficiently, loading classes
> on demand, garbage-collecting, etc., stuff that's not immediately
> obvious until you think really hard about it. Thinking really hard about
> it rather misses the point today when we're concerned with writing code
> whose only goal is to accomplish something cool. We usually no longer
> have to worry, as I had to 30+ years ago in my first job, about code
> size, memory overlays, resident TEXT, page faults, etc.
>
> Life's good now!
Aha! That's what I was missing!
I'm still new to Eclipse so it's difficult to reason about what might cause these problems.
Thanks for your explanations.
|
|
|
Re: Infamous Source Not Found message debugging [message #1015818 is a reply to message #1015779] |
Sun, 03 March 2013 07:02 |
bhrgunatha deva Messages: 7 Registered: February 2013 |
Junior Member |
|
|
Russell Bateman wrote on Sat, 02 March 2013 12:55
> On 03/02/2013 02:40 AM, bhrgunatha deva wrote:
> > Russell Bateman wrote on Thu, 28 February 2013 10:12
> >> On 2/28/2013 5:04 AM, bhrgunatha deva wrote:
> >> > [snip]
> > It does - all helpful information. Thanks. Seems I need to be more
> > careful about using Step Into and setting breakpoints. It's strange
> > because I'm sure that I was able to step into my own constructors
> > without going into the platforms loader classes.
> > Still at least I know what's happening now.
>
> What's happening is that when you are able to step into your
> constructors without the loader class getting called first it's because
> your class has already been loaded for a reason that's opaque to you
> some other class caused it to be loaded for a less than obvious reason
> and so it was already there.
>
> Remember that Java execution isn't a sequence of machine instructions as
> it is when you're stepping through an application written in C/C++. It's
> virtual machine instructions being interpreted by a very intelligent
> interpreter, the JVM, that does things very efficiently, loading classes
> on demand, garbage-collecting, etc., stuff that's not immediately
> obvious until you think really hard about it. Thinking really hard about
> it rather misses the point today when we're concerned with writing code
> whose only goal is to accomplish something cool. We usually no longer
> have to worry, as I had to 30+ years ago in my first job, about code
> size, memory overlays, resident TEXT, page faults, etc.
>
> Life's good now!
Aha! That's what I was missing!
I'm still new to Eclipse so it's difficult to reason about what might cause these problems.
Thanks for your explanations.
|
|
|
Goto Forum:
Current Time: Wed Sep 25 23:06:14 GMT 2024
Powered by FUDForum. Page generated in 0.08844 seconds
|