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

File not found when loading external resource in a jar file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.2
    • 8.0.1
    • None
    • None

      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

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

              Created:
              Updated:
              Resolved:

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