pinpoint-apm/pinpoint · error · IOException

not found class

Error message

not found class 

What it means

This IOException is thrown by ASMInterceptorHolder.readClass when the class loader of ASMInterceptorHolder cannot locate the requested .class file as a resource on the classpath. It acts as a defensive check before handing the stream to ASM's ClassReader, which would otherwise fail with a less clear NullPointerException. It indicates the bytecode of the class to be instrumented/analyzed is not visible to the profiler's class loader.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java:182

    byte[] toInnerClassByteArray() throws InstrumentException {
        try {
            ClassNode classNode = readClass(INTERCEPTOR_HOLDER_INNER_CLASS);
            final ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
            final ClassVisitor renameClassAdapter = new RenameInnerClassAdapter(classWriter, className);
            classNode.accept(renameClassAdapter);
            return classWriter.toByteArray();
        } catch (IOException e) {
            // read fail
            throw new InstrumentException("ClassReader fail, classFile=" + INTERCEPTOR_HOLDER_INNER_CLASS, e);
        }
    }

    ClassNode readClass(String classFileName) throws IOException {
        final ClassLoader classLoader = ASMInterceptorHolder.class.getClassLoader();
        final InputStream inputStram = classLoader.getResourceAsStream(classFileName);
        if (inputStram == null) {
            // defense code
            throw new IOException("not found class " + classFileName);
        }

        try {
            final ClassReader classReader = new ClassReader(inputStram);
            ClassNode classNode = new ClassNode();
            classReader.accept(classNode, 0);
            return classNode;
        } finally {
            inputStram.close();
        }
    }

    static class Builder {
        private final InterceptorHolderIdGenerator interceptorHolderIdGenerator;
        private ClassLoader classLoader;
        private InterceptorFactory interceptorFactory;
        private Class<? extends Interceptor> interceptorClass;
        private Object[] providedArguments;

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Verify the classFileName is the correct resource-style path (e.g. 'com/example/Foo.class') and exists in a jar/dir on the profiler classpath
  2. Add the jar containing the class to the profiler's classpath (pinpoint.profiler.classpath or the agent lib directory)
  3. Check for typos or renamed classes after a version upgrade; rebuild the plugin
  4. If the class is a bootstrap class, load it via the bootstrap handler rather than the profiler class loader

Example fix

// before
ClassNode node = holder.readClass("com/example/Mylnterceptor.class");
// after
ClassNode node = holder.readClass("com/example/MyInterceptor.class"); // fixed typo
Defensive patterns

Strategy: try-catch

Validate before calling

String resource = classFileName;
if (ASMInterceptorHolder.class.getClassLoader().getResource(resource) == null) {
    throw new IllegalArgumentException("class resource missing from profiler classpath: " + resource);
}

Type guard

boolean isLoadable(String classFileName) {
    return classFileName != null && classFileName.endsWith(".class")
        && ASMInterceptorHolder.class.getClassLoader().getResource(classFileName) != null;
}

Try / catch

try {
    ClassNode node = holder.readClass(classFileName);
} catch (IOException e) {
    logger.error("class resource not on profiler classpath: {}", classFileName, e);
}

Prevention

When it happens

Trigger: Calling readClass with a classFileName (resource path) that does not exist on the profiler's classpath, e.g. a misspelled internal class name, a class from a plugin jar not on the profiler classpath, or a resource path missing the '.class' suffix or using dots instead of slashes.

Common situations: Plugin development where the interceptor/helper class was renamed or moved; profiler-classpath configuration in pinpoint.config (-Dpinpoint.profiler.classpath or lib dir) missing a jar; instrumenting bootstrap classes that are not readable as resources from the profiler loader.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/e73168bf348a3119. Report an issue: GitHub.