Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2011

java.lang.IllegalArgumentException during Weld startup - because of '%' in URL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.3.0.CR1, 3.0.0.Alpha13
    • 2.2.6.Final, 2.2.14.Final
    • None
    • None

    Description

      If the indexUrlString that is used in JandexIndexBeanArchiveHandler.loadJandexIndex(String s) contains a '%' sign, an IllegalArgumentException is thrown.

      Having a '%' in an URL that is not meant to escape some character (like %20 for space) is totally fine both on Windows and Unix machines.
      Executing java.net.URL.openStream(), as it happens in the JandexIndexBeanArchiveHandler.loadJandexIndex(String s), leads to execution of sun.net.www.ParseUtil.decode(String s) which expects an encoded URL string. If the URL is not encoded, a NumberFormatException is catched by sun.net.www.ParseUtil and an IllegalArgumentException is thrown.

      Therefore, the URL should be encoded (possibly by using the java.net.URLEncoder) before trying to call the openStream method.

      I found another Issue with a similar title but missing description: https://issues.jboss.org/browse/WELD-1987

      Attachments

        Activity

          People

            mkouba@redhat.com Martin Kouba
            weldissimo Michael Weldington (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: