Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3123

File not found when loading external resource in a jar file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.1
    • Fix Version/s: 8.0.2
    • Component/s: None
    • Labels:
      None

      Description

      As title, For cases like a resource in located in a jar file
      We use jetty embedded as container and we setup manually the resource location to be into jar files (new PathResource(new URL(JarResource.newJarResource(new PathResource(uiURL))))

      It later however fail trying to load resources. The offending code is in the HtmlTreeBuilder class where a URL is always converted to be a File. The proposed patch uses url.openStream instead and solves the issue.

      Test case : https://github.com/vimpagliazzo/zk-loader-testcase
      Do a "mvn install" on the root project, then "cd zk-loader-runner" and run mvn exec:java -Dexec.mainClass="Runner".
      And you can see the error open http://localhost:8090/index.zhtml

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            DevChu DevChu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d