Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-6416

Special case JDK9+ URLClassLoader url resource loading

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • framework-6.0.4
    • Framework
    • None
    • MacOS

    Description

      '#' sign represents URL fragment and is not valid URL path element.

      As per spec it is not allowed for it to be a part of path and instead must be URL encoded.

      So for example for file in location in UNIX systems: "/Users/piotrklimczak/test#", the valid URL encoding to load it in Java is:

      new File(new URL("file:///Users/piotrklimczak/test%23").toURI()) 

      Works.

      While

      new File(new URL("file:///Users/piotrklimczak/test#").toURI()) 

      Returns java.lang.IllegalArgumentException in Java: URI has a fragment component

      FELIX-6326 effectively allows '#' to be accepted as valid URL path element, which in turn breaks JDK9+ URLClassLoader which is using URL fragment (ref) to deal with multi-release jars.

      This then breaks pax-transx-tm-narayana installation in Karaf 4.3.1 (which uses URLClassLoader).

      In my opinion FELIX-6326 should be reverted and users should be encoding special characters correctly in their resource paths as per above example.

      I've taken a risk to mark it as a blocker as effectively it blocks using Narayana TM, rendering Karaf 4.3.1 not usable for us.
      Feel free to downgrade it if my judgement failed here.

      Attachments

        Issue Links

          Activity

            People

              karlpauls Karl Pauls
              nannou9 Piotr Klimczak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: