Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15485

Last modified check of Resource created from Tomcat war:file: URL fails with FileNotFoundException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.3.8
    • Fix Version/s: 4.3.9, 5.0 RC1
    • Component/s: Core
    • Labels:
      None

      Description

      This is, I believe, a regression due to the changes made in this commit. A side-effect of those changes is that AbstractFileResolvingResource now proceeds with file system resolution where as, previously, it would have use the last modified header on the URL connection.

      The file system resolution fails with an exception like this:

      java.io.FileNotFoundException: Jar URL cannot be resolved to absolute file path because it does not reside in the file system: war:file:/home/vbao/service/vbao-web.war*/js/bootstrap.min.js
      	at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:215)
      	at org.springframework.core.io.AbstractFileResolvingResource.getFileForLastModifiedCheck(AbstractFileResolvingResource.java:67)
      	at org.springframework.core.io.AbstractResource.lastModified(AbstractResource.java:153)
      	at org.springframework.core.io.AbstractFileResolvingResource.lastModified(AbstractFileResolvingResource.java:169)
      	at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:345)
      	…
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                awilkinson Andy Wilkinson
                Last updater:
                Stéphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 20 weeks, 1 day ago