Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8072064

toLowerCase() in java.net.HostPortrange fails on underscore character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u25, 9, 9.0.1, 10
    • core-libs
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      should not matter

      A DESCRIPTION OF THE PROBLEM :
      In NetBeans 8.0.2 running on JDK 1.8.0_25 I was adding a Web Service Client. I inserted WSDL address, but the environment constantly returned "Problem with downloading wsdl or schema file", although it worked in other applications.
      After thorough investigation I have found that the problem is that the address contained underscores and the error is invoked by the IllegalArgumentException("Invalid characters in hostname") that was thrown by toLoweCase() method in java.net.HostPortrange.
      This method checks the characters of an address and if they are not within [a-z0-9A-Z.-] an exception is thrown even though also other characters are valid in URL.

      ADDITIONAL REGRESSION INFORMATION:
      The same problem was in 1.8.0_11 and 1.8.0_05. The problem was not in 1.7.0_65.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      In NetBeans running on 1.8.0_xx create a new project and add a Web Service Client and as a WSDL URL use a URL containing underscores. After clicking Finish, an error message appears. In View/IDE Log then could be seen:

      INFO [org.netbeans.modules.websvc.core.client.wizard.ClientInfo]: "Unable to check if wsdl is rpc encoded."
      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:481)
      at java.net.URLPermission.parseURI(URLPermission.java:449)
      at java.net.URLPermission.init(URLPermission.java:170)
      at java.net.URLPermission.<init>(URLPermission.java:166)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected result is no exception and WSDL normally added.
      ACTUAL -
      The request fails with an error described above.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      INFO [org.netbeans.modules.websvc.core.client.wizard.ClientInfo]: "Unable to check if wsdl is rpc encoded."
      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:481)
      at java.net.URLPermission.parseURI(URLPermission.java:449)
      at java.net.URLPermission.init(URLPermission.java:170)
      at java.net.URLPermission.<init>(URLPermission.java:166)
      at sun.net.www.protocol.http.HttpURLConnection.URLtoSocketPermission(HttpURLConnection.java:1031)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:981)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Using java 1.7 or working with code where WSDL was already imported.

      SUPPORT :
      YES

            chegar Chris Hegarty
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: