Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 442330

Summary: "Source not found." when debugging remote
Product: [Eclipse Project] JDT Reporter: Stefan Cordes <rsc>
Component: DebugAssignee: Sarika Sinha <sarika.sinha>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: marcel.bruch, Michael_Rennie, sarika.sinha
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Stefan Cordes CLA 2014-08-22 03:17:07 EDT
Since Juno (Kepler worked fine) I cannot debug my source remotely.

I start an Webstart App via
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8118 
and connect via "Remote Java Application" Launch and all default and port localhost 8118.

Breakpoint works fine but source window shows "Source not found.".

Open Type shows the source.
Right Mouse click on the Stacktrace and "Open Declared Type" shows the source.

BUT:

Attaching the Java Project where the Source is in:
Short flicker and then "Source not found.".

Attaching a Java Project which depends on the one with the source:
Short flicker and then "Source not found.".

Attaching file system "src" folder:
Short flicker and then "Source not found.".


In the Eclipse Error Log are no entries for that action.

So stepping through the remote program is merely hard as always the 
"Source not found."
comes back.

Any workaround?
Comment 1 Stefan Cordes CLA 2014-08-22 03:17:58 EDT
Correction:
Since _Luna_ (4.4.0)
Comment 2 Sarika Sinha CLA 2014-08-22 04:54:41 EDT
Attachments are missing.
Comment 3 Stefan Cordes CLA 2014-08-22 05:54:41 EDT
Found a clearer problem description:

When a breakpoint is reached via remote debugging and "Edit Source Lookup" is used there, the source does not appear.

After disconnecting and connecting again the the VM the source path is used and the source is visible.

So workaround:
disconnect and re-connect to the remote VM after changing source lookup path.
Comment 4 Michael Rennie CLA 2014-08-25 08:58:23 EDT
*** Bug 442406 has been marked as a duplicate of this bug. ***
Comment 5 Marcel Bruch CLA 2014-08-26 01:39:08 EDT
The very same issue happens to when debugging JUnit tests in the IDE without going over tcp sockets.

FWIW, I've a unit test that executes a class in an x-internal package (OSGI-bundle).
Comment 6 Marcel Bruch CLA 2014-08-26 01:51:08 EDT
(In reply to Marcel Bruch from comment #5)
> FWIW, I've a unit test that executes a class in an x-internal package
> (OSGI-bundle).

Ignore that part. Suddenly, I can step into the code.
The only change (I'm aware of) I made was closing a second (completely unrelated) Eclipse instance I had running on the same machine. However, this also seems unrelated because after restarting that second IDE again, I could still step into the source code.
Comment 7 Michael Rennie CLA 2014-08-26 08:26:06 EDT
(In reply to Marcel Bruch from comment #5)
> The very same issue happens to when debugging JUnit tests in the IDE without
> going over tcp sockets.
> 
> FWIW, I've a unit test that executes a class in an x-internal package
> (OSGI-bundle).

The Java debugger always uses socket communication, even for 'local' launches. That said, is there any chance we could get a test project / steps to reproduce the issue? I tried a local and remote debug session and could see source as I stepped, so any more clues would be greatly appreciated.
Comment 8 Marcel Bruch CLA 2014-08-26 08:31:05 EDT
(In reply to Michael Rennie from comment #7)
> That said, is there any chance we could get a test project / steps
> to reproduce the issue?

It's yet not reliably reproducible for me. Here's what I think could make sense. I'll let my IDE run with -Xdebug etc. and will connect to it from another instance as soon as the problem occurs again.

Can you give me some pointers in which methods I should set breakpoints and start analyzing myself?
Comment 9 Michael Rennie CLA 2014-08-26 08:57:40 EDT
(In reply to Marcel Bruch from comment #8)
> (In reply to Michael Rennie from comment #7)
> > That said, is there any chance we could get a test project / steps
> > to reproduce the issue?
> 
> It's yet not reliably reproducible for me. Here's what I think could make
> sense. I'll let my IDE run with -Xdebug etc. and will connect to it from
> another instance as soon as the problem occurs again.
> 
> Can you give me some pointers in which methods I should set breakpoints and
> start analyzing myself?

Try these classes:

org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant
org.eclipse.jdt.launching.sourcelookup.containers.JavaSourceLookupParticipant
org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility

A related bug in source lookup that was recently fixed is bug 437193, perhaps also grab a recent I-build and see if the problem persists.
Comment 10 Eclipse Genie CLA 2020-05-05 05:37:32 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.