pinpoint-apm/pinpoint · info
Failed to close JarFile:
Error message
Failed to close JarFile:
What it means
After appending boot jars to the bootstrap class loader, the code closes each opened JarFile in a finally block; if closing one fails the exception is logged as this warning. Instrumentation continues; this indicates a leaked/locked jar handle or filesystem oddity, not a failed load.
Solutions
- Generally safe to ignore — the agent proceeds; verify the agent started normally afterwards
- On Windows, exclude the agent directory from antivirus scanning
- Avoid replacing/deleting agent jars while the JVM is running
- If it recurs, check for duplicate boot jar entries in the agent's boot directory
Defensive patterns
Strategy: retry
Prevention
- Treat this as non-fatal; confirm 'pinpoint agent started normally' appears afterwards
- On Windows, exclude the agent dir from antivirus/backup locks
- Never mutate agent jars while the JVM is running
When it happens
Trigger: JarFile.close() throws due to OS-level file locking (Windows), an already-closed handle, or the jar file being deleted/moved while the JVM holds it open.
Common situations: Running on Windows with antivirus or another process holding the jar; agent directory swapped while the JVM is starting; duplicated jar handles opened during appendToBootstrapClassLoader.
Understand the failure class
Background: "open() failed", "failed to open file", "cannot create file" — what a file open error means and how to fix it — this error's family across 42 libraries.
Related errors
- create fail
- banner IO failed
- can read
- create fail Caused by:
- I/O error getting type provider definitions
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/2352b3169b37a39a.
Report an issue: GitHub.
Appendix: source
Thrown at agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/PinpointBootStrap.java:160
logger.info("agentParameter:" + agentArgs);
}
return agentArgsMap;
}
private void appendToBootstrapClassLoader(Instrumentation instrumentation, BootDir bootDir) {
List<JarFile> jarFiles = bootDir.openJarFiles();
try {
for (JarFile jarFile : jarFiles) {
Path path = FileUtils.subpathAfterLast(Paths.get(jarFile.getName()), 2);
logger.info("appendToBootstrapClassLoader:" + path);
instrumentation.appendToBootstrapClassLoaderSearch(jarFile);
}
} finally {
for (JarFile jarFile : jarFiles) {
try {
jarFile.close();
} catch (Exception e) {
logger.warn("Failed to close JarFile:" + jarFile.getName(), e);
}
}
}
}
private static void logPinpointAgentLoadFail() {
final String errorLog =
"*****************************************************************************\n" +
"* Pinpoint Agent load failure\n" +
"*****************************************************************************";
System.err.println(errorLog);
}
}
View on GitHub (pinned to 744c3d3075)