pinpoint-apm/pinpoint · warning
Invalid bootstrap class loader. cl=
Error message
Invalid bootstrap class loader. cl={} What it means
This warn is the fallback path of BootstrapClassLoaderHandler.getResourceAsStream: the provided targetClassLoader is not the bootstrap classloader, so the handler refuses to look up the resource and returns null. It signals an API misuse — a bootstrap-classloader-only handler was given a non-bootstrap loader.
Solutions
- Verify targetClassLoader is actually the bootstrap loader before calling this handler.
- Route non-bootstrap loaders to PlainClassLoaderHandler (or URLClassLoaderHandler) in PluginClassInjector.
- Log/handle the null return instead of assuming a valid stream.
- Check for containers that wrap the bootstrap loader in a delegating wrapper and compare against Object.class.getClassLoader() semantics.
Example fix
// before
handler.getResourceAsStream(targetClassLoader, internalName);
// after
if (targetClassLoader == Object.class.getClassLoader()) {
return bootstrapHandler.getResourceAsStream(targetClassLoader, internalName);
}
return plainHandler.getResourceAsStream(targetClassLoader, internalName); Defensive patterns
Strategy: type-guard
Validate before calling
boolean isBootstrap = (targetClassLoader == Object.class.getClassLoader());
Type guard
static boolean isBootstrapClassLoader(ClassLoader cl) {
return cl == Object.class.getClassLoader();
} Prevention
- Always check loader identity before calling bootstrap-only handlers
- Route non-bootstrap loaders to PlainClassLoaderHandler
- Beware container wrappers around the bootstrap loader
- Treat a null return as a routing bug signal
When it happens
Trigger: getResourceAsStream invoked with any ClassLoader other than the bootstrap loader (PluginClassInjector only routes here when the target loader is the bootstrap loader, so a routing/mismatch or custom call with the wrong loader triggers it).
Common situations: Custom instrumentation code calling the bootstrap handler directly with an application classloader; changes in loader routing logic; classloader identity assumptions broken by custom containers.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- duplicated pluginClass
- Failed to load plugin class
- Failed to load plugin class
- Failed to load plugin class
- Failed to load plugin class
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/6ea09f8e6e2962fa.
Report an issue: GitHub.
Appendix: source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/classloading/BootstrapClassLoaderHandler.java:96
}
}
@Override
public InputStream getResourceAsStream(ClassLoader targetClassLoader, String internalName) {
try {
if (targetClassLoader == null) {
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
if (classLoader == null) {
return null;
}
appendToBootstrapClassLoaderSearch();
return classLoader.getResourceAsStream(internalName);
}
} catch (Exception e) {
logger.warn("Failed to load plugin resource as stream {} with classLoader", internalName, e);
return null;
}
logger.warn("Invalid bootstrap class loader. cl={}", targetClassLoader);
return null;
}
}View on GitHub (pinned to 744c3d3075)