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 0728257ddb35..e32e239cf835 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 @@ -843,8 +843,9 @@ protected Set doFindPathMatchingJarResources(Resource rootDirResource, rootEntryPath = (jarEntry != null ? jarEntry.getName() : ""); closeJarFile = !jarCon.getUseCaches(); } - catch (FileNotFoundException ex) { - // Happens in case of cached root directory without specific subdirectory present. + catch (ZipException | FileNotFoundException ex) { + // Happens in case of a non-jar file or in case of a cached root directory + // without specific subdirectory present, respectively. return Collections.emptySet(); } }