diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java index c24739d498..2f3ea7f360 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java @@ -418,12 +418,14 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol protected void addClassPathManifestEntries(Set result) { try { String javaClassPathProperty = System.getProperty("java.class.path"); - for (String url : StringUtils.delimitedListToStringArray( + for (String path : StringUtils.delimitedListToStringArray( javaClassPathProperty, System.getProperty("path.separator"))) { try { - if (url.endsWith(ResourceUtils.JAR_FILE_EXTENSION)) { + if (path.endsWith(ResourceUtils.JAR_FILE_EXTENSION)) { + File file = new File(path); UrlResource jarResource = new UrlResource(ResourceUtils.JAR_URL_PREFIX + - ResourceUtils.FILE_URL_PREFIX + url + ResourceUtils.JAR_URL_SEPARATOR); + ResourceUtils.FILE_URL_PREFIX + file.getAbsolutePath() + + ResourceUtils.JAR_URL_SEPARATOR); if (jarResource.exists()) { result.add(jarResource); } @@ -431,7 +433,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol } catch (MalformedURLException ex) { if (logger.isDebugEnabled()) { - logger.debug("Cannot search for matching files underneath [" + url + + logger.debug("Cannot search for matching files underneath [" + path + "] because it cannot be converted to a valid 'jar:' URL: " + ex.getMessage()); } }