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 130307 - IllegalArgumentException: URI is not hierarchical
Summary: IllegalArgumentException: URI is not hierarchical
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL: http://statistics.netbeans.org/except...
Keywords:
: 139111 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-17 16:31 UTC by Peter Nabbefeld
Modified: 2009-05-19 11:45 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 3688


Attachments
stacktrace (2.95 KB, text/plain)
2008-03-17 16:33 UTC, Peter Nabbefeld
Details
stacktrace (2.52 KB, text/plain)
2008-07-10 12:01 UTC, pbw
Details
stacktrace (2.84 KB, text/plain)
2008-09-09 08:33 UTC, Erno Mononen
Details
stacktrace (2.10 KB, text/plain)
2009-02-02 12:40 UTC, Erno Mononen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Nabbefeld 2008-03-17 16:31:43 UTC
Build: NetBeans IDE Dev (Build 200803170003)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05
OS: Windows 2000, 5.0, x86

User Comments: 
After opening NB as project group (it is immediately going to scan/compile/scan)
Comment 1 Peter Nabbefeld 2008-03-17 16:33:58 UTC
Created attachment 58502 [details]
stacktrace
Comment 2 Milan Kubec 2008-03-18 13:42:47 UTC
Probably duplicate of issue #120842.

What do you mean by "After opening NB as project group"? Thanks for explanation.
Comment 3 Peter Nabbefeld 2008-03-18 15:17:39 UTC
0. (probably installed plugin)
1. Downloaded NB sources
2. Started NB
3. Tried to create a group of projects with opening all of the NB sources
Comment 4 Milan Kubec 2008-03-18 15:35:50 UTC
Do you really mean all of almost 690 modules???
Comment 5 Peter Nabbefeld 2008-03-18 16:00:45 UTC
As far as I remember, it have been about 800-900 ;-)
Yes, I tried - but will never try again ;-)
Too much time, some errors, thus aborted. What I've noticed: Many build-impl files seem to contain manual changes, at
least I've been told of external changes (though I didn't even touch the machine for other puposes than pressing ok or
cancel to error messages).
Comment 6 Milan Kubec 2008-03-18 16:39:17 UTC
OK then, it's kind of very edge case and cause for the exception might be almost "anything". I'd rather close the issue,
if you agree, but for now at least I'm going to lower the priority to P4.
Comment 7 Peter Nabbefeld 2008-03-18 17:17:50 UTC
Probably You should at least check the NB sub projects for bad build-impl files - some people should probably correct
their build design. If lesss errors occur, it will be easier to find out about the rest - and errors shouldn't be
"enforced" by just editing what isn't intended to be edited ...
Comment 8 Exceptions Reporter 2008-06-13 04:38:55 UTC
This issue has already 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=3688
Comment 9 pbw 2008-07-10 12:00:56 UTC
Build: NetBeans IDE 6.1 (Build 200804211638)
VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06
OS: Linux, 2.6.22.18-0.2-bigsmp, i386

User Comments: 
Tried to open existing project, without setting project as main.

I have just reported this 3 or 4 times (sorry about that), but the report is classified as a duplicate of 103644, which is concerned with opening project as a main. I can dismiss the notification, but I cannot open my project. This has only started to occur following an upgrade of my modules.
Comment 10 pbw 2008-07-10 12:01:00 UTC
Created attachment 64240 [details]
stacktrace
Comment 11 Erno Mononen 2008-09-09 08:33:41 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14
OS: Linux, 2.6.24-19-generic, amd64

User Comments: 
Thrown while a clean build invoked from the command line was running in the background, otherwise was just browsing source (not editing).

Stacktrace: 
java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:363)
        at org.netbeans.modules.java.freeform.Classpaths$SourcePRI.computeMatcher(Classpaths.java:657)
        at org.netbeans.modules.java.freeform.Classpaths$SourcePRI.<init>(Classpaths.java:650)
        at org.netbeans.modules.java.freeform.Classpaths$MutableClassPathImplementation.initRoots(Classpaths.java:602)
        at org.netbeans.modules.java.freeform.Classpaths$MutableClassPathImplementation.change(Classpaths.java:623)
        at org.netbeans.modules.java.freeform.Classpaths.pathsChanged(Classpaths.java:531)
Comment 12 Erno Mononen 2008-09-09 08:33:46 UTC
Created attachment 69381 [details]
stacktrace
Comment 13 Milan Kubec 2008-11-21 09:50:14 UTC
*** Issue 139111 has been marked as a duplicate of this issue. ***
Comment 14 qno67 2009-01-28 15:22:16 UTC
Here is a scenario that can always trigger this exception in my NB 6.5 installation:

1.) Create an Ant project not related to Netbeans.
2.) In that project, use intermediate directories for compiling. In my case it was needed because token replacement had
to be performed on some source javacc grammar files to produce the actual real source grammars and the generated parser
files were significantly different after the token replacements.

Make sure that the "clean" target removes the intermediate directories themselves too, not only the files inside them.

3.) Build the project. All the intermediate directories will be created.
4.) Now import the project into NetBeans as freeform java project.
5.) Set source directories in the NetBeans project property editor so that the intermediate directories containing
generated files are listed. It is needed by the IDE to find the real sources during debugging and profiling.
6.) Add IDE callbacks for debugging and profiling as needed.
7.) Now you should be able to build, debug and profile the project.
8.) Exit NetBeans.
9.) Run the buld script from outside specifying the "clean" target. All the intermediate directories (that were added
inside the IDE as source paths) should disappear.
10.) Start NetBeans and try to open your imported freeform project. Nothing should be opened, you should get the
Exception with the "URI is not hierarchical" message.
11.) Exit the IDE.
12.) Build the project from the command line again to recreate the intermediate directories.
13.) Start NetBeans again and try to open the project. This time it should succeed.
Comment 15 Erno Mononen 2009-02-02 12:40:44 UTC
Build: NetBeans IDE 6.5 (Build 081024)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14
OS: Linux, 2.6.27-11-generic, amd64

User Comments: 


Stacktrace: 
java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:363)
        at org.netbeans.modules.java.freeform.Classpaths$SourcePRI.computeMatcher(Classpaths.java:655)
        at org.netbeans.modules.java.freeform.Classpaths$SourcePRI.<init>(Classpaths.java:648)
        at org.netbeans.modules.java.freeform.Classpaths$MutableClassPathImplementation.initRoots(Classpaths.java:600)
        at org.netbeans.modules.java.freeform.Classpaths$MutableClassPathImplementation.change(Classpaths.java:621)
        at org.netbeans.modules.java.freeform.Classpaths.pathsChanged(Classpaths.java:529)
Comment 16 Erno Mononen 2009-02-02 12:40:48 UTC
Created attachment 76457 [details]
stacktrace
Comment 17 soundchaser 2009-03-05 21:04:26 UTC
I have a freeform project that shows similar behavior in NetBeans 6.5

It prevents many projects that used to load just fine in NetBeans to load now. I can "fix" the project by removing all 
references to zip source files.

What happens for me is that any source file being listed as a package-root under a compilation-unit will make the 
exception appear. It seems, from the number of duplicates, that this is an important regression. I propose the priority 
to be raised to at least 2.

Sample problematic case:

(a freeform project)
        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
            <compilation-unit>
<package-root>${javami.BASE_CC_DRIVE}/msn_shared/win/wkgpframework_sdk/avid/workgroups/src/api</package-root>

Comment 18 soundchaser 2009-03-05 21:07:28 UTC
Bad copy/paste from previous entry... continuing:

        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
            <compilation-unit>
                <package-root>some_source_archive.zip</package-root>

I've also tried

                <package-root>jar:file:some_source_archive.zip!/</package-root>

Without success

Comment 19 Antonin Nebuzelsky 2009-03-20 16:19:36 UTC
Reassigning to Jesse.
Comment 20 Jesse Glick 2009-03-21 22:04:36 UTC
No steps to reproduce were provided. The closest I get is a comment about

  <package-root>some_source_archive.zip</package-root>

which is illegal; NB projects do not support primary sources inside ZIP files. (Binary classpath entries can of course
be in JARs, and it is fine to associate a ZIP of sources with a binary classpath entry.)
Comment 21 Jesse Glick 2009-03-21 22:07:53 UTC
Exception reduced to a warning in the log file. core-main #dac34f5f01d8
Comment 22 Quality Engineering 2009-03-22 08:31:23 UTC
Integrated into 'main-golden', will be available in build *200903220201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dac34f5f01d8
User: Jesse Glick <jglick@netbeans.org>
Log: #130307: more graceful handling of illegal source root.