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 244843 - All projects show "Invalid include path" error
Summary: All projects show "Invalid include path" error
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-02 18:09 UTC by dharkness
Modified: 2015-08-20 08:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Fresh launch log file (54.10 KB, text/plain)
2014-06-04 18:58 UTC, dharkness
Details
Folders in global include path (28.98 KB, image/png)
2014-06-04 19:03 UTC, dharkness
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dharkness 2014-06-02 18:09:16 UTC
Since upgrading to 8.0, all of my PHP projects report an invalid include path when I right-click on any of the projects and select "Resolve Project Problems..." However, once I click "Resolve...", none of the paths shown are marked as invalid, and there's no message at the bottom of the dialog stating that any are invalid.

Opening the Tools : PHP panel, none of the paths listed there are marked as invalid either.

Is there some log file that will list out the invalid paths? They all work for code-completion, so they can't be invalid, but I'm at a loss at this point.
Comment 1 Vladimir Riha 2014-06-03 06:38:37 UTC
Could you please attach IDE log (see [1]) , perhaps there will be some information

[1] http://wiki.netbeans.org/FaqLogMessagesFile
Comment 2 Tomas Mysik 2014-06-03 07:26:30 UTC
Or simply create a sample projects and attach them here, we will look at it. Or at least provide detailed steps to reproduce this problem (what you have exactly on your Include Path).

Please, reopen this issue, thanks.
Comment 3 dharkness 2014-06-04 18:58:28 UTC
Created attachment 147568 [details]
Fresh launch log file
Comment 4 dharkness 2014-06-04 19:02:51 UTC
Log attached, but didn't mean to assign the bug to myself.

I see four warnings:

* one for too many untracked SVN files from a directory I deleted prior to launching NetBeans (I've launched it twice now and it still reports this missing directory)

* two for "Ignoring root with no ClassPath":

WARNING [org.netbeans.modules.java.source.indexing.JavaIndex]: Ignoring root with no ClassPath: /usr/local/hgm/library/ZF_1-11-10
WARNING [org.netbeans.modules.java.source.indexing.JavaIndex]: Ignoring root with no ClassPath: /usr/local/hgm/library/HGM

* one for "use of system property netbeans.home ..."

One of the projects has no include folders of its own, so it's clearly coming from the global include paths. However, all exist and in the attached screenshot you can see all four listed. I can expand each in the Projects view and see the files under them, so NetBeans obviously finds them. And NetBeans doesn't complain about them on the Tools dialog.
Comment 5 dharkness 2014-06-04 19:03:57 UTC
Created attachment 147569 [details]
Folders in global include path
Comment 6 dharkness 2014-06-04 19:15:15 UTC
I think I found the problem. There are four folders in the global include path, but two of them are inside a (currently closed) NetBeans project. One is the project's source folder (/src) while the other is another set of PHP files (/bootstrap). Removing this second "non-source" folder clears the problem.

When I try to add it back, double-clicking on the project's root folder places that root folder (not the source folder /src) into the list instead of opening the folder so I can select the /bootstrap folder. However, I am able to expand the root folder and then double-click on /bootstrap to get it into the list, and the problem returns.

Thinking that for now I could live with the root of the project being in the include path (the tests will be scanned and available for code completion, but that's not a deal-breaker), however I still get the warning about an invalid include path with that root folder in the list and the source folder removed.

So it seems that you can place any folder into the include path UNLESS that folder or some folder up the hierarchy contains an nbproject folder AND the folder is not the "source folder" for said project.
Comment 7 Tomas Mysik 2014-06-05 05:21:59 UTC
The thing is that you cannot use any _subfolder_ of any other PHP project sources (Source Files or Test Files), you must use directly the root folders of these sources.

Will have a look why there is no warning visible in the UI.

Thanks.
Comment 8 dharkness 2014-06-06 02:23:38 UTC
Well, I need to do this. The Sources folder /src contains the classes that make up our testing folder. However, the /bootstrap folder contains "source files" that provide global functions and bootstrapping for various project types. 

I understood the reasoning behind a warning ("Hey, you should probably only include the root /src folder"), but I see no technical reason to make doing so an unrecoverable error. Provide a warning for guidance, but let me do what I want if you can. 

Now, perhaps the latest NB version adds a technical reason, e.g., it builds a reusable index of the "sources folder" for every project. If that's the case, I can probably work around it. 

Background: /src maps directly to a second-level package to simplify the package Explorer. Without it, the SF node would contain one item that it's contains one item that the. Contains many folders representing subpackages. I have already adjusted my folder structure to make the IDE more usable; I don't want to do it again, especially since I can't solve both problems. 

Can this error be turned into a warning? Does it cause other problems?
Comment 9 slavb18 2014-07-24 06:24:46 UTC
I  see same issue since NB 8.0
please change to warning, becouse it shows  all projects with errors
"Some directories on project's Include Path are invalid."
Comment 10 Vm4wtppN 2015-05-29 07:47:35 UTC
I found a quick way aroundy this. 
I created a hard link ***outside*** any project root, linking to the desired resource. 
Netbeans had no problem accepting it as a global include source.
Comment 11 Tomas Mysik 2015-08-20 08:53:01 UTC
Taking over, I guess I will be solving this issue, right? ;)

I will try to reproduce this issue and fix the missing message in Project Properties dialog.

Thanks.
Comment 12 Tomas Mysik 2015-08-20 08:58:12 UTC
I just tried it and it works for me without any problem - the IDE reports project with invalid Include Path; once Resolve... button is clicked, proper error message is shown together with a dialog asking whether this error should be fixed or not.

Thanks.

Product Version: NetBeans IDE Dev (Build 20150820-b673fb947706)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Linux version 3.19.0-26-generic running on amd64; UTF-8; cs_CZ (nb)