quarkusio/quarkus · error · UncheckedIOException
Unable to read entry: ${configFileName} from jar: ${jarFile}
Error message
Unable to read entry: ${configFileName} from jar: ${jarFile} What it means
Thrown as an UncheckedIOException when the AOT serializer cannot open or read an application config file entry (application.properties / application.yaml style resources) inside a jar during serialization. Signals a corrupt jar, an entry that vanished, or a closed/invalid zip file.
Source
Thrown at independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/AotSerializedApplication.java:283
public Map<String, List<ApplicationConfigEntry>> getApplicationConfigFiles() {
return applicationConfigFiles;
}
@Override
public void visitJarFileEntry(JarFile jarFile, ZipEntry fileEntry) {
if (!AotRunnerClassLoader.isApplicationConfigFile(fileEntry.getName())) {
return;
}
String configFileName = fileEntry.getName();
try (var is = jarFile.getInputStream(fileEntry)) {
String jarName = Paths.get(jarFile.getName()).getFileName().toString();
applicationConfigFiles.computeIfAbsent(configFileName, k -> new ArrayList<>())
.add(new ApplicationConfigEntry(jarName + "!/" + configFileName, is.readAllBytes()));
} catch (IOException e) {
throw new UncheckedIOException("Unable to read entry: " + configFileName + " from jar: " + jarFile, e);
}
}
@Override
public void visitRegularFile(Path jar, Path file, String relativePath) {
if (!AotRunnerClassLoader.isApplicationConfigFile(relativePath)) {
return;
}
try {
String jarName = jar.getFileName().toString();
applicationConfigFiles.computeIfAbsent(relativePath, k -> new ArrayList<>())
.add(new ApplicationConfigEntry(jarName + "!/" + relativePath, Files.readAllBytes(file)));
} catch (IOException e) {
throw new UncheckedIOException("Unable to read file: " + relativePath, e);
}
}
}View on GitHub (pinned to e1c734241f)
Solutions
- Rebuild or re-download the offending jar (mvn clean package) — corruption is the usual cause.
- Verify jar integrity: jar tf <jarFile> or unzip -t; replace any jar that fails.
- Ensure no process rebuilds/copies the lib directory while the application is starting or being serialized.
- Check free disk space and complete file transfers before launching.
Example fix
// before mvn package // after mvn clean package && unzip -t target/quarkus-app/lib/*.jar # verify each jar opens
Defensive patterns
Strategy: validation
Validate before calling
for (Path jar : libs) {
if (!Files.isReadable(jar)) throw new IllegalStateException("unreadable jar: " + jar);
try (var zf = new java.util.zip.ZipFile(jar.toFile())) { if (zf.getEntry(configFileName) == null) log.warn("missing entry " + configFileName); }
} Type guard
boolean isValidJar(Path p) { try (var zf = new java.util.zip.ZipFile(p.toFile())) { return zf.size() >= 0; } catch (Exception e) { return false; } } Try / catch
try { app.start(); } catch (UncheckedIOException e) { if (e.getMessage().contains("Unable to read entry")) { log.error("Corrupt jar detected: {}", e.getMessage(), e); throw new IllegalStateException("Redeploy application — corrupt jar", e); } throw e; } Prevention
- Verify jars with unzip -t / jar tf after transfer.
- Use atomic copy (temp + rename) when deploying.
- Check disk space before packaging.
- Never rebuild jars while the application is starting.
When it happens
Trigger: visitJarFileEntry calls jarFile.getInputStream(fileEntry) or is.readAllBytes() for an isApplicationConfigFile entry and an IOException occurs — typically a truncated or corrupted jar in the lib directory.
Common situations: Interrupted/incomplete download or copy of an application jar; disk-full during packaging; jar rebuilt (entries invalidated) while the app is serializing; running from a partially-updated lib/ directory.
Related errors
- Unable to read entry: ${fileEntry.getName()} from jar: ${jar
- Failed to read zip entry ${res}
- Failed to process
- Failed to read
- Failed to open ${jarResource.jarPath}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/0754140c56456dd7.
Report an issue: GitHub.