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.
Build: NetBeans IDE 7.4 (Build 201310111528) VM: Java HotSpot(TM) Client VM, 25.0-b59, Java(TM) SE Runtime Environment, 1.8.0-ea-b117 OS: Windows 7 User Comments: dimaki: Cannot connect to bitbucket.org GIT repo. Stacktrace: java.lang.IllegalArgumentException: Invalid characters in hostname at java.net.HostPortrange.toLowerCase(HostPortrange.java:189) at java.net.HostPortrange.<init>(HostPortrange.java:150) at java.net.URLPermission$Authority.<init>(URLPermission.java:476) at java.net.URLPermission.parseURI(URLPermission.java:446) at java.net.URLPermission.init(URLPermission.java:167) at java.net.URLPermission.<init>(URLPermission.java:163)
Created attachment 142612 [details] stacktrace
What URL are you entering before getting this exception? It must be an invalid one.
No. It's the one pasted directly from the bitbucket.org project page. The URL is working fine when using 'git clone ...' on the command line. I tried the HTTPS and the SSH URL. I switched back to jdk 1.7.0_45 and rebooted the system and now git clone works. (In reply to Ondrej Vrabec from comment #2) > What URL are you entering before getting this exception? It must be an > invalid one.
with jdk 1.8 b116 this worked fine, started occurring in b117. This seems to happen when trying to open a http(s) connection to a server with username in the URL: https://ovrabec@bitbucket.org/ovrabec/anagramgame.git. From debugging: 1) at java.net.HostPortrange.toLowerCase(HostPortrange.java:189) 2) at java.net.HostPortrange.<init>(HostPortrange.java:150) 3) at java.net.URLPermission$Authority.<init>(URLPermission.java:476) 4) at java.net.URLPermission.parseURI(URLPermission.java:446) 5) at java.net.URLPermission.init(URLPermission.java:167) 6) at java.net.URLPermission.<init>(URLPermission.java:163) 6) called as URLPermission("https://ovrabec@bitbucket.org/ovrabec/anagramgame.git/info/refs", "GET:Accept-Encoding,Pragma,User-Agent,Accept") 3) instantiated as URLPermission$Authority("https", "ovrabec@bitbucket.org") 2) finally hostname is incorrectly parsed in HostPortrange.<init> and tries to call toLowerCase(ovrabec@bitbucket.org) 100% reproducible, cannot clone a git repository over https with authentication
the difference between b116 and b117 is the last step in the stacktrace. While b116 simply called: > hoststr = hoststr.toLowerCase(); b117 now calls: > hoststr = HostPortrange.toLowerCase(hoststr); In both builds the current value of hoststr was "ovrabec@bitbucket.org", the new method cannot handle '@' and throws the exception. According to spec at http://tools.ietf.org/html/rfc3986#section-3.2.1 username may probably contain also other non-ascii characters (encoded as %XX i guess) so permitting only '@' may not be sufficient. JDK should probably correctly parse just the host name and skip the userinfo part of the URI.
Ondro, thanks for the detailed evaluation. JDK bug: https://bugs.openjdk.java.net/browse/JDK-8029354
*** Bug 239632 has been marked as a duplicate of this bug. ***
*** Bug 258756 has been marked as a duplicate of this bug. ***