{"record":{"id":"fd2f0731a8d2a5ac","repo":"pinpoint-apm/pinpoint","slug":"not-found-class-classloader-cl-classinternaln","errorCode":null,"errorMessage":"not found class. classLoader=${cl}, classInternalName=${classInternalName}","messagePattern":"not found class\\. classLoader=(.+?), classInternalName=(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/classreading/ClassReaderWrapper.java","lineNumber":88,"sourceCode":"    }\n\n    // classloader and class internal name.\n    public ClassReaderWrapper(final ClassLoader classLoader, final String classInternalName, final boolean readAttributes) throws IOException {\n        Objects.requireNonNull(classInternalName, \"classInternalName\");\n\n        ClassLoader cl = classLoader;\n        if (cl == null) {\n            cl = ClassLoader.getSystemClassLoader();\n            if (cl == null) {\n                // system fail.\n                throw new IOException(\"system classloader is null.\");\n            }\n        }\n\n        final String classPath = classInternalName.concat(\".class\");\n        final InputStream in = cl.getResourceAsStream(classPath);\n        if (in == null) {\n            throw new IOException(\"not found class. classLoader=\" + cl + \", classInternalName=\" + classInternalName);\n        }\n\n        byte[] bytes = IOUtils.toByteArray(in);\n        this.classReader = new ClassReader(bytes);\n        if (readAttributes) {\n            readAttributes();\n        }\n    }\n\n    // class's access flags.\n    public int getAccess() {\n        return this.classReader.getAccess();\n    }\n\n    // class version.\n    public int getVersion() {\n        return this.classReader.readShort(6);\n    }","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/classreading/ClassReaderWrapper.java#L70-L106","documentation":"IOException thrown by ClassReaderWrapper when getResourceAsStream(classInternalName + \".class\") returns null, meaning the class bytecode could not be located in the given classloader. Pinpoint needs the raw .class bytes to build a ClassReader for instrumentation analysis.","triggerScenarios":"ClassReaderWrapper invoked for an internal name whose resource is not visible from the supplied ClassLoader - the class is missing, not yet loaded/defined in that loader, or located in a parent/sibling loader.","commonSituations":"Classes generated at runtime (proxies, lambdas, codegen) that have no corresponding .class resource, classes in an app-server webapp loader accessed with the wrong (parent) loader, or shaded/relocated classes whose internal name changed.","solutions":["Verify the classInternalName matches the actual class location (package/path, no leading slash issues).","Pass the classloader that actually defines/loads the class (e.g. clazz.getClassLoader()), not an arbitrary one.","If the class is runtime-generated, read bytes from the generator instead of relying on a classloader resource.","Log the classloader's classpath/URLs and confirm the jar containing the class is present."],"exampleFix":"// before\nwrapper.readClassInternalName(\"com/foo/Generated$Proxy\", parentLoader);\n// after\nwrapper.readClassInternalName(\"com/foo/Generated$Proxy\", proxyClass.getClassLoader());","handlingStrategy":"validation","validationCode":"String path = classInternalName.replace('.', '/') + \".class\";\nif (cl.getResource(path) == null) { /* class not visible from this loader - pick another */ }","typeGuard":null,"tryCatchPattern":"try { wrapper.readClassInternalName(name, cl); } catch (IOException e) { if (e.getMessage().startsWith(\"not found class\")) { logger.warn(\"class {} invisible from {}\", name, cl); } throw e; }","preventionTips":["Use clazz.getClassLoader() as the resource loader","Handle runtime-generated classes separately from jar-packaged ones","Verify internal names after any shading/relocation"],"tags":["classloading","resource-not-found","classreader","pinpoint"],"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"}