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 159022 - java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/NetBeans Dev 200902220201/java2/modules/org-netbeans-modules-java-source-ant.jar
Summary: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL: http://statistics.netbeans.org/except...
Keywords: REGRESSION
: 159490 159526 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-24 02:44 UTC by _ gtzabari
Modified: 2009-04-01 10:28 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 146631


Attachments
stacktrace (3.59 KB, text/plain)
2009-02-24 02:44 UTC, _ gtzabari
Details
stacktrace (4.87 KB, text/plain)
2009-02-24 02:45 UTC, _ gtzabari
Details
stacktrace (3.72 KB, text/plain)
2009-02-24 10:19 UTC, Exceptions Reporter
Details
stacktrace (3.79 KB, text/plain)
2009-02-24 11:51 UTC, mps77
Details
stacktrace (3.81 KB, text/plain)
2009-02-26 10:26 UTC, chronosmark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2009-02-24 02:44:32 UTC
Build: NetBeans IDE Dev (Build 200902220201)
VM: OpenJDK 64-Bit Server VM, 14.0-b10, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b01
OS: Windows Vista, 6.0, amd64

User Comments:
gtzabari: Hit F6 to run the project



Stacktrace: 
java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at org.openide.filesystems.FileUtil.archiveOrDirForURL(FileUtil.java:1915)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.buildScript(ProjectRunnerImpl.java:324)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.execute(ProjectRunnerImpl.java:114)
        at org.netbeans.api.java.project.runner.JavaRunner.execute(JavaRunner.java:262)
        at org.netbeans.modules.java.j2seproject.J2SEActionProvider.bypassAntBuildScript(J2SEActionProvider.java:1145)
Comment 1 _ gtzabari 2009-02-24 02:44:37 UTC
Created attachment 77270 [details]
stacktrace
Comment 2 _ gtzabari 2009-02-24 02:45:34 UTC
Build: NetBeans IDE Dev (Build 200902220201)
VM: OpenJDK 64-Bit Server VM, 14.0-b10, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b01
OS: Windows Vista, 6.0, amd64

User Comments: 


Stacktrace: 
java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at org.openide.filesystems.FileUtil.archiveOrDirForURL(FileUtil.java:1915)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.buildScript(ProjectRunnerImpl.java:324)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.execute(ProjectRunnerImpl.java:114)
        at org.netbeans.api.java.project.runner.JavaRunner.execute(JavaRunner.java:262)
        at org.netbeans.modules.java.j2seproject.J2SEActionProvider.bypassAntBuildScript(J2SEActionProvider.java:1145)
Comment 3 _ gtzabari 2009-02-24 02:45:37 UTC
Created attachment 77271 [details]
stacktrace
Comment 4 _ gtzabari 2009-02-24 02:46:56 UTC
Netbeans is mishandling path spaces. This is a regression relative to Netbeans 6.5.
Comment 5 Exceptions Reporter 2009-02-24 08:19:00 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=146631
Comment 6 Jiri Skrivanek 2009-02-24 09:23:21 UTC
It is caused by the fix of issue 156330. As Jesse pointed out in desc5, you have to use File.toUri() to properly escape
special characters (in this case ' ').
Comment 7 Exceptions Reporter 2009-02-24 10:19:05 UTC
Build: NetBeans IDE Dev (Build 200902221401)
VM: Java HotSpot(TM) Client VM, 1.5.0_10-b03, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_10-b03
OS: Windows XP, 5.1, x86

User Comments: 
This occurs when running a project

Stacktrace: 
java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at org.openide.filesystems.FileUtil.archiveOrDirForURL(FileUtil.java:1915)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.buildScript(ProjectRunnerImpl.java:324)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.execute(ProjectRunnerImpl.java:114)
        at org.netbeans.api.java.project.runner.JavaRunner.execute(JavaRunner.java:262)
        at org.netbeans.modules.java.j2seproject.J2SEActionProvider.bypassAntBuildScript(J2SEActionProvider.java:1145)
Comment 8 Exceptions Reporter 2009-02-24 10:19:15 UTC
Created attachment 77283 [details]
stacktrace
Comment 9 mps77 2009-02-24 11:51:10 UTC
Build: NetBeans IDE Dev (Build 200902231401)
VM: Java HotSpot(TM) Client VM, 15.0-b01, Java(TM) SE Runtime Environment, 1.7.0-ea-b48
OS: Windows XP, 5.1, x86

User Comments: 
debug current file... ctrl+shift f5 or menu item 

Stacktrace: 
java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:859)
        at org.openide.filesystems.FileUtil.archiveOrDirForURL(FileUtil.java:1915)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.buildScript(ProjectRunnerImpl.java:324)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.execute(ProjectRunnerImpl.java:114)
        at org.netbeans.api.java.project.runner.JavaRunner.execute(JavaRunner.java:262)
        at org.netbeans.modules.java.j2seproject.J2SEActionProvider.bypassAntBuildScript(J2SEActionProvider.java:1145)
Comment 10 mps77 2009-02-24 11:51:15 UTC
Created attachment 77290 [details]
stacktrace
Comment 11 chronosmark 2009-02-26 10:26:28 UTC
Build: NetBeans IDE Dev (Build 200902251401)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Windows XP, 5.1, x86

User Comments: 
Attempting to run project.

Stacktrace: 
java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at org.openide.filesystems.FileUtil.archiveOrDirForURL(FileUtil.java:1915)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.buildScript(ProjectRunnerImpl.java:324)
        at org.netbeans.modules.java.source.ant.ProjectRunnerImpl.execute(ProjectRunnerImpl.java:114)
        at org.netbeans.api.java.project.runner.JavaRunner.execute(JavaRunner.java:262)
        at org.netbeans.modules.java.j2seproject.J2SEActionProvider.bypassAntBuildScript(J2SEActionProvider.java:1145)
Comment 12 chronosmark 2009-02-26 10:26:38 UTC
Created attachment 77402 [details]
stacktrace
Comment 13 mps77 2009-02-27 11:13:42 UTC
Temporary workaround: install netbeans to the path without space(s) :)

example install dir: C:\NetbeansDev\ or \home\nbfun\netbeansdev 
Comment 14 Jaroslav Tulach 2009-03-02 15:34:19 UTC
I believe this is the result of eliminating new File(...).toURI() from the 
http://hg.netbeans.org/ergonomics/rev/ff93758eb7eb
Jesse suggested in one of his emails to replace that code with VFile subclass. Here it is:
http://hg.netbeans.org/ergonomics/rev/d19edaf83fa9
I hope it helps. Please verify.

ergonomics#d19edaf83fa9
Comment 15 Jaroslav Tulach 2009-03-02 15:36:55 UTC
This is result of 'run' of JavaApplication project (it is located in a space in path location):

init:
deps-jar:
Created dir: E:\Documents and Settings\jarda\My Documents\NetBeansProjects\JavaApplication1\build\classes
Compiling 1 source file to E:\Documents and Settings\jarda\My Documents\NetBeansProjects\JavaApplication1\build\classes
compile:
run:
BUILD SUCCESSFUL (total time: 0 seconds)

The IDE itself was installed in space in path location as well:

  Current Directory       = Z:\src\netbeans\ergonomics\nbbuild\nb w dot
  User Directory          = Z:\src\netbeans\ergonomics\nbbuild\testuserdir
  Installation            = Z:\src\netbeans\ergonomics\nbbuild\nb w dot\nb6.7
                            Z:\src\netbeans\ergonomics\nbbuild\nb w dot\ergonomics1
                            Z:\src\netbeans\ergonomics\nbbuild\nb w dot\ide11
                            Z:\src\netbeans\ergonomics\nbbuild\nb w dot\java2
                            Z:\src\netbeans\ergonomics\nbbuild\nb w dot\xml2

I guess this issue is fixed.
Comment 16 Jiri Skrivanek 2009-03-03 09:44:47 UTC
*** Issue 159490 has been marked as a duplicate of this issue. ***
Comment 17 Jesse Glick 2009-03-03 16:13:06 UTC
*** Issue 159526 has been marked as a duplicate of this issue. ***
Comment 18 Peter Nabbefeld 2009-03-03 16:49:44 UTC
There has been a comment ("Additional comments from jtulach Mon Mar 2 15:34:19 +0000 2009") saying this bug might be
related to ergonomics. I'm getting this exception though disabled ergonomics on install.

The problem seems to be caused by improper use of URI instead of URL (the first one is more restrictive!). Probably
there should be some re-thinking about URI usage - either don't use them, if You don't need them, or encode them
properly. Better though, use FileObject and/or InputStream (or OutputStream) where ever possible.
Comment 19 Peter Nabbefeld 2009-03-03 16:52:08 UTC
Sorry, I've seen too late, it's been fixed yesterday. Will test it tomorrow (as daily build not yet available).
Comment 20 Peter Nabbefeld 2009-03-04 14:35:59 UTC
Tested with daily build 200903040201 - still there, thus reopened.
Comment 21 Peter Nabbefeld 2009-03-04 14:36:49 UTC
Forgot to reopen.
Comment 22 Peter Nabbefeld 2009-03-04 14:49:59 UTC
Sorry again - same problem, other module (seems to be autoupdate problem) - created new issue #159612.
Comment 23 martinhavle 2009-04-01 10:28:32 UTC
No issues with ' ' in paths, seems to be fixed properly.