Closed
Description
Andy Wilkinson opened SPR-15485 and commented
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)
…
Affects: 4.3.8
Reference URL: spring-projects/spring-boot#8986
Issue Links:
- PathMatchingResourcePatternResolver fails to work under Tomcat 8.0.41 with unpackWARs=false [SPR-15332] #19895 PathMatchingResourcePatternResolver fails to work under Tomcat 8.0.41 with unpackWARs=false
- HTTP 404 for static resources with last modified = 0L (breaks Docker images build with Jib) [SPR-17320] #21853 HTTP 404 for static resources with last modified = 0L (breaks Docker images build with Jib)