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 216436 - java.net.URISyntaxException: Illegal character in path at index 22: http://localhost:8383/ d d/index.html
Summary: java.net.URISyntaxException: Illegal character in path at index 22: http://lo...
Status: VERIFIED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.3
Hardware: All All
: P1 normal (vote)
Assignee: David Konecny
URL:
Keywords:
: 217528 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-08-06 11:40 UTC by Vladimir Riha
Modified: 2012-09-24 11:29 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 191314


Attachments
stacktrace (913 bytes, text/plain)
2012-08-06 11:40 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-08-06 11:40:17 UTC
Build: NetBeans IDE Dev (Build EaselCSS-441-on-20120805)
VM: Java HotSpot(TM) Client VM, 23.2-b09, Java(TM) SE Runtime Environment, 1.7.0_06-ea-b20
OS: Linux

User Comments:
vriha: I intentionally added incorrect path to Web Root settings and run project




Stacktrace: 
java.net.URISyntaxException: Illegal character in path at index 22: http://localhost:8383/    d   d/index.html
   at java.net.URI$Parser.fail(URI.java:2829)
   at java.net.URI$Parser.checkChars(URI.java:3002)
   at java.net.URI$Parser.parseHierarchical(URI.java:3086)
   at java.net.URI$Parser.parse(URI.java:3034)
   at java.net.URI.<init>(URI.java:595)
   at java.net.URL.toURI(URL.java:936)
Comment 1 Vladimir Riha 2012-08-06 11:40:19 UTC
Created attachment 122781 [details]
stacktrace
Comment 2 Vladimir Riha 2012-09-20 18:44:45 UTC
*** Bug 217528 has been marked as a duplicate of this bug. ***
Comment 3 Petr Jiricka 2012-09-20 18:47:53 UTC
David, I thought you were fixing something like this recently, right?
Comment 4 Vladimir Riha 2012-09-20 19:20:05 UTC
reproducible in 

Product Version: NetBeans IDE Dev (Build 201209200001)
Updates: Updates available
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 3.5.0-4-generic running on amd64; UTF-8; en_US (nb)
Comment 5 David Konecny 2012-09-20 19:55:39 UTC
I did, but not everywhere. I did not test it for non-existent path.
Comment 6 David Konecny 2012-09-20 23:32:27 UTC
Tomas, could you review my fix please? There is no utility method AFAICT to convert string URL into URL which does not fail when toURI() is called on it. So I had to create my own utility:

b9ae852e2715

To reproduce open Proj Props and set Web Root to a value with spaces in it. I tried to put spaces everywhere, eg.

http://localhost:8383/HTML%205%20Application/a%20a%20a%20a/i%20n%20d%20e%20x.html

and it seems to work but testing this well would be good. Workaround is obvious: do not use spaces in your web root.

Thanks.
Comment 7 Tomas Mysik 2012-09-21 04:15:32 UTC
I think that your solution is good. Another (perhaps a bit ugly) way to do it could be:

new URI("http", "//localhost/my folder?my key=my value", null).toURL()

Of course, the best way would be:

org.apache.commons.httpclient.util.URIUtil.encodeQuery("http://localhost/my folder?my key=my value");
Comment 8 David Konecny 2012-09-21 07:37:12 UTC
Tomas, could you integrate this fix into the branch as well please after it was tested by QA? Thanks. Otherwise I will do it tomorrow morning my time.
Comment 9 Vladimir Riha 2012-09-21 07:44:10 UTC
I'll test in ~2hours (once my local build finished)
Comment 10 Tomas Mysik 2012-09-21 07:53:22 UTC
(In reply to comment #8)
> Tomas, could you integrate this fix into the branch as well please after it was
> tested by QA? Thanks. Otherwise I will do it tomorrow morning my time.

Will do it, no problem.
Comment 11 Tomas Mysik 2012-09-21 07:54:09 UTC
Adding keyword.
Comment 12 Vladimir Riha 2012-09-21 08:52:56 UTC
unable to reproduce the way I did (simply add spaces to web root), please backport

Product Version: NetBeans IDE Dev (Build 20120921-5ed37588c5fc)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 13 Tomas Mysik 2012-09-21 09:10:22 UTC
Backported however I had to manually fix conflict in dependencies - Davide, please verify the patch. Thanks.

http://hg.netbeans.org/releases/rev/0550ac0ad81d
Comment 14 Petr Jiricka 2012-09-21 09:38:29 UTC
I am not sure the spec version increase is correct, they differ intentionally in beta vs. trunk, see Tonda's commits:
http://hg.netbeans.org/web-main/rev/ac5f3444bb61
http://hg.netbeans.org/releases/rev/df13c208b8c4

Shoudn't the version on the beta branch be 1.3.2?
Comment 15 Tomas Mysik 2012-09-21 09:58:09 UTC
(In reply to comment #14)
> Shoudn't the version on the beta branch be 1.3.2?

You are probably right... Tondo, can you confirm? I would fix it in the beta branch.

Thanks.
Comment 16 Antonin Nebuzelsky 2012-09-21 15:32:14 UTC
> I am not sure the spec version increase is correct,
> they differ intentionally in beta vs. trunk

What the scripts do for a branch and for the trunk is the following:

  trunk before branching - spec version was A.B
  on the new branch - spec will be A.B.1
  trunk after the branching - new spec will be A.B+1

This ensures that the spec versions of all modules in comparison meet the following rule:

 before branching < on the branch < after branching on trunk

If you are trying to increase the spec version of a module on the branch to be higher than the spec version on trunk now then this is wrong.
Comment 17 Tomas Mysik 2012-09-21 15:52:57 UTC
If I understand it correctly, PetrJ was right. I will fix it on the branch.
Comment 18 Tomas Mysik 2012-09-21 16:03:49 UTC
(In reply to comment #17)
> If I understand it correctly, PetrJ was right. I will fix it on the branch.

Done. I would appreciate if anyone could review it. Thanks.

http://hg.netbeans.org/releases/rev/d034352b331e
Comment 19 Petr Jiricka 2012-09-21 16:55:27 UTC
Thanks, that's exactly what I was thinking it should be.
Comment 20 Quality Engineering 2012-09-22 02:14:59 UTC
Integrated into 'main-golden', will be available in build *201209220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b9ae852e2715
User: David Konecny <dkonecny@netbeans.org>
Log: #216436 - java.net.URISyntaxException: Illegal character in path at index 22: http://localhost:8383/ d d/index.html
Comment 21 Vladimir Riha 2012-09-24 11:29:49 UTC
verified in Beta, but it introduced issue 218889

Product Version: NetBeans IDE 7.3 Beta (Build 201209232010)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)