Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ private static List<String> listXmlFiles(ClassLoader classLoader, String folder)
.forEach(p -> xmlFilePaths.add(folder + "/" + p.getFileName().toString()));
}
} else if ("jar".equals(protocol)) {
// Running from a jar
// Running from a jar. Disable caching so each connection opens its own
// JarFile instance; the default cached instance is shared across threads
// and closing it (via try-with-resources) causes "zip file closed" errors
// in concurrent callers.
JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
jarConnection.setUseCaches(false);
try (JarFile jarFile = jarConnection.getJarFile()) {
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
Expand Down