Bug 169963 - java.net.URISyntaxException: Illegal character in opaque part at index 22: jar:file:/C:/Documents and Settings/A148999/Mis documentos/workspace/LIBRARIES/JSF-FACELETS/lib/commons-beanutils.jar!/
java.net.URISyntaxException: Illegal character in opaque part at index 22: ja...
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: JSF
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Alexey Butenko
issues@javaee
http://statistics.netbeans.org/except...
EXCEPTIONS_REPORT
: SPACE_IN_PATH
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-06 09:55 UTC by vieiro
Modified: 2009-08-21 06:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (2.79 KB, text/plain)
2009-08-06 09:55 UTC, vieiro
Details
screenshot-1 (22.09 KB, image/png)
2009-08-07 08:10 UTC, vieiro
Details
screenshot-2 (25.92 KB, image/png)
2009-08-07 08:10 UTC, vieiro
Details
screenshot-3 (30.35 KB, image/png)
2009-08-07 08:10 UTC, vieiro
Details
MYJSFLIBRARY.xml (2.08 KB, text/xml)
2009-08-07 08:11 UTC, vieiro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vieiro 2009-08-06 09:55:10 UTC
Build: NetBeans IDE Dev (Build 200908022240)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments:
vieiro: Adding a new JSF library in a Web Project



Stacktrace: 
java.net.URISyntaxException: Illegal character in opaque part at index 22: jar:file:/C:/Documents and Settings/A148999/Mis documentos/workspace/LIBRARIES/JSF-FACELETS/lib/commons-beanutils.jar!/
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parse(URI.java:3019)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URI.create(URI.java:840)
        at org.netbeans.modules.project.ant.ProjectLibraryProvider.copyLibrary(ProjectLibraryProvider.java:1048)
Comment 1 vieiro 2009-08-06 09:55:15 UTC
Created attachment 85891 [details]
stacktrace
Comment 2 Jesse Glick 2009-08-07 00:55:22 UTC
The root problem is some library definition which specifies a malformed URL:

jar:file:/C:/Documents and Settings/A148999/Mis documentos/workspace/LIBRARIES/JSF-FACELETS/lib/commons-beanutils.jar!/

should be:

jar:file:/C:/Documents%20and%20Settings/A148999/Mis%20documentos/workspace/LIBRARIES/JSF-FACELETS/lib/commons-beanutils.jar!/

Reporter, please locate the $userdir/config/org-netbeans-api-project-libraries/Libraries/*.xml which contains this bad
URL. (You can correct it on disk as a workaround.) In order to fix, we would need to know when this entry was added to
the file (probably when the file was created - but was this in an old userdir which you imported), and what IDE feature
was responsible for creating the file - e.g. Tools > Library Manager, or something else?
Comment 3 vieiro 2009-08-07 08:09:34 UTC
Steps to reproduce (NB 6.8 M1):

1.- Create a brand new web project.
2.- Proceed through the Wizard. On the "Frameworks" step select "JavaServer Faces" (which should read "Java Server
Faces", by the way).
3.- Select the "Create New Library" option.
  3.1.- On the "JSF Directory" select a directory where the JSF jar files are available (I think this seeks for
jsf-api.jar or something).
  3.2.- On the "Library Name" enter a dummy name. In this very test case I entered "MYJSFLIBRARY".
[See screenshot-1]

After a (long?) while an exception happens
[See screenshot-2].

I'm attaching the two screenshots and the generated "MYJSFLIBRARY.xml" file. Note that this file contains spaces instead
of "%20".




Comment 4 vieiro 2009-08-07 08:10:13 UTC
Created attachment 85940 [details]
screenshot-1
Comment 5 vieiro 2009-08-07 08:10:34 UTC
Created attachment 85941 [details]
screenshot-2
Comment 6 vieiro 2009-08-07 08:10:58 UTC
Created attachment 85942 [details]
screenshot-3
Comment 7 vieiro 2009-08-07 08:11:27 UTC
Created attachment 85943 [details]
MYJSFLIBRARY.xml
Comment 8 Jesse Glick 2009-08-07 18:01:13 UTC
JSFUtils.java line 157:

URL url = jars[i].toURL();
url = FileUtil.getArchiveRoot(url);
urls.add(url);

You should know that File.toURL is deprecated in JDK 6 for the good reason that it doesn't work. Always use
File.toURI().toURL() instead. (Even that is broken for UNC paths but supposedly the fix for issue #46813 made it not
matter.) Anyway there is an easier way to handle getting classpath-format URLs from File's:

URL url = FileUtil.urlForArchiveOrDir(jars[i]);
if (url != null {
    urls.add(url);
}
Comment 9 Alexey Butenko 2009-08-20 13:55:14 UTC
http://hg.netbeans.org/web-main/rev/1550275c5713
Comment 10 Quality Engineering 2009-08-21 06:16:03 UTC
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1550275c5713
User: Alexey Butenko <alexeybutenko@netbeans.org>
Log: #169963: NPE fix


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo