{"record":{"id":"e73168bf348a3119","repo":"pinpoint-apm/pinpoint","slug":"not-found-class","errorCode":null,"errorMessage":"not found class ","messagePattern":"not found class ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java","lineNumber":182,"sourceCode":"    byte[] toInnerClassByteArray() throws InstrumentException {\n        try {\n            ClassNode classNode = readClass(INTERCEPTOR_HOLDER_INNER_CLASS);\n            final ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES);\n            final ClassVisitor renameClassAdapter = new RenameInnerClassAdapter(classWriter, className);\n            classNode.accept(renameClassAdapter);\n            return classWriter.toByteArray();\n        } catch (IOException e) {\n            // read fail\n            throw new InstrumentException(\"ClassReader fail, classFile=\" + INTERCEPTOR_HOLDER_INNER_CLASS, e);\n        }\n    }\n\n    ClassNode readClass(String classFileName) throws IOException {\n        final ClassLoader classLoader = ASMInterceptorHolder.class.getClassLoader();\n        final InputStream inputStram = classLoader.getResourceAsStream(classFileName);\n        if (inputStram == null) {\n            // defense code\n            throw new IOException(\"not found class \" + classFileName);\n        }\n\n        try {\n            final ClassReader classReader = new ClassReader(inputStram);\n            ClassNode classNode = new ClassNode();\n            classReader.accept(classNode, 0);\n            return classNode;\n        } finally {\n            inputStram.close();\n        }\n    }\n\n    static class Builder {\n        private final InterceptorHolderIdGenerator interceptorHolderIdGenerator;\n        private ClassLoader classLoader;\n        private InterceptorFactory interceptorFactory;\n        private Class<? extends Interceptor> interceptorClass;\n        private Object[] providedArguments;","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java#L164-L200","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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","Add the jar containing the class to the profiler's classpath (pinpoint.profiler.classpath or the agent lib directory)","Check for typos or renamed classes after a version upgrade; rebuild the plugin","If the class is a bootstrap class, load it via the bootstrap handler rather than the profiler class loader"],"exampleFix":"// before\nClassNode node = holder.readClass(\"com/example/Mylnterceptor.class\");\n// after\nClassNode node = holder.readClass(\"com/example/MyInterceptor.class\"); // fixed typo","handlingStrategy":"try-catch","validationCode":"String resource = classFileName;\nif (ASMInterceptorHolder.class.getClassLoader().getResource(resource) == null) {\n    throw new IllegalArgumentException(\"class resource missing from profiler classpath: \" + resource);\n}","typeGuard":"boolean isLoadable(String classFileName) {\n    return classFileName != null && classFileName.endsWith(\".class\")\n        && ASMInterceptorHolder.class.getClassLoader().getResource(classFileName) != null;\n}","tryCatchPattern":"try {\n    ClassNode node = holder.readClass(classFileName);\n} catch (IOException e) {\n    logger.error(\"class resource not on profiler classpath: {}\", classFileName, e);\n}","preventionTips":["Use resource-style paths with slashes and .class suffix","Verify the jar is on the profiler classpath after every agent upgrade","Add a startup self-check that reads all configured helper classes","Keep class names in one constants class to avoid typos"],"tags":["classloader","instrumentation","java-agent"],"backgroundTag":"class-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}