This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 196411 - "Breakpoint's source file does not belong into the preferred source root" when I have the project open
Summary: "Breakpoint's source file does not belong into the preferred source root" whe...
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal with 8 votes (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 19:12 UTC by quidryan
Modified: 2014-06-13 14:30 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quidryan 2011-03-07 19:12:51 UTC
I'm debugging from a maven project, and found that I need another project opened, Project2, so I opened it. I tried adding a debug point but got the error "Breakpoint's source file does not belong into the preferred source root". I looked at Windows->Debugging->Sources and I see the Project2-sources.jar from the maven repository, but not for Project2 that I just opened from a checkout subversion directory.

I disconnected from the debugging session, then close, then open Project2. It then works. It looks like Opening a project is not updating a live debugging session.
Comment 1 savan 2011-10-27 13:53:19 UTC
This also happened to me.  When it happened to me I was debugging and I had two classes in my workspace, same name, same package, but different projects.

Workaround
The breakpoint I was trying to add was in the file listed 2nd in debugging sources.  I moved the project containing the file to which I wanted to add the breakpoint to the top of the list and it worked.
Comment 2 jeffery.yuan 2011-11-30 08:30:06 UTC
Meet same problem today in Netbeans 7.1RC1, and followed savan's workaround, and it worked.
But I think this should be resolved if possible in future release.
Comment 3 WalterGdot 2011-12-16 10:35:31 UTC
Same problem when debugging: Breakpoints were not reachable.
in my situation problem occured this way:
1.)i checked out a Project via subversion and created a Netbeans Project with Existing Sources
2.)created a totally new Project in NetBeans
   - wrong Classpath, when rightclicked on one of the classes where the breakpoints were not reachable, were shown
   - the Classpath of the last checked out project were shown (not the one of the actual project)
3.)rightclicked the Netbeans Project and in Properties/Libraries removed the wrong entry in the "Compile-time" Libraries
4.)debuger worked as usual
Comment 4 bht 2013-02-01 19:23:03 UTC
Could this perhaps be fixed by adding project sources of a new project at the top of the list of breakpoints gaining top priority? Not knowing what the problem is, I would intuitively try to close and re-open the failing project. Moving multiple source packages all the way up from the bottom as suggested as workaround is hard to do at times.
Comment 5 4nt01ne 2014-06-13 14:30:20 UTC
I have the same issue in NB 8.0 (Build 201403101706).
I could not put a breakpoint in source of 2nd maven module.
The 1st module was referring to an older version of the 2nd one. NB claimed to have that same old version source.
I fixed this by updating pom of the 1st module to refer to current version of 2nd module