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 180063 - Cannot compute classpath dependencies when importing a NB 6.5 Freeform project
Summary: Cannot compute classpath dependencies when importing a NB 6.5 Freeform project
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-01 03:25 UTC by jfeid
Modified: 2011-04-26 16:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
an example of one module's project.xml (28.79 KB, application/xml)
2010-06-06 17:05 UTC, Rich Unger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jfeid 2010-02-01 03:25:17 UTC
I'm using NB 6.5 for a big free form JavaEE/GWT project with several modules. A couple of days ago I downloaded NB 6.8 and I was happy with the speedy response and tried to import the project. A lot number of package/class not found problems appeared for sources that definetely exist. The IDE log has numerous lines like the one below:

[org.netbeans.modules.java.editor.imports.ComputeImports]: Cannot resolve type element "ElementHandle[kind=CLASS; sigs=_THECLASS_ ]"
Comment 1 Tomas Zezula 2010-02-09 05:44:12 UTC
Mostly caused by freeform project set up. Some projects which "worked" in NB < 6.7 should not work in 6.7+ as the IDE has stronger checks. Please take a look at http://wiki.netbeans.org/FaqScanningAndIndexingPerformanceHints section Configure you freeform projects correctly.
Please attach the project metadata (nbproject folder).
Thanks
Comment 2 jfeid 2010-02-09 16:02:15 UTC
Followed the guidelines at http://wiki.netbeans.org/FaqFreeformMultipleSourceRoots and classpath errors disappeared. It seems that the defined Test Package Folders were the problem's source.
Thanks for pointing out.
Comment 3 Rich Unger 2010-06-06 17:03:48 UTC
I'm having a similar issue, and I believe I'm configuring my projects correctly, but I'm open to correction on that point, as the linked documentation is not completely clear to me on a few points.

My source tree is broken up into modules.  I'm configuring each module as a separate freeform project.  I'm computing the full classpath of each module (including its whole dependency tree) and including the jars and classes/ directories of all those modules in the compile classpath of a single compilation-unit.

Many of my modules appear fine in after scanning sources.  However, any module depending on the module "sfdc" do not.  The modules all have the classes directory containing the classes that NB thinks are missing in their compilation unit's classpath.  "sfdc" is by far the biggest module, so I wonder if there's a memory issue.

Is there a way to do this differently?  Can I declare a dependency on the sfdc module and pull in the resulting classpath automatically, without copying sfdc's classpath into the project.xml of every module that depends on it?

I've read through http://wiki.netbeans.org/FaqFreeformMultipleSourceRoots
and my situation most closely resembles #1.  Source trees either get compiled together, or they get compiled to different directories, but have dependencies on each other (e.g. submoduleA/java/src and submoduleB/java/src get compiled to different places, but reference each other).

I'll attach an example project.xml.

Is there some other way to get this to work?
Comment 4 Rich Unger 2010-06-06 17:05:04 UTC
Created attachment 99841 [details]
an example of one module's project.xml
Comment 5 Tomas Zezula 2011-04-26 16:51:26 UTC
I've looked on the attached project.xml.
The answer depends on what is in /home/runger/dev/app/main/core/sfdc/java/classes.
If it's a build output (contains classes) and there is correctly configured source for binary query (in case of freeform project <built-to> element mapping the folder to <package-root> element) it should work fine (at least it works for my freeform projects).
If the /home/runger/dev/app/main/core/sfdc/java/classes is a package root (contains sources) it's not supported (the source folder is added into classpath not source path). See http://wiki.netbeans.org/FaqScanningAndIndexingPerformanceHints