{"record":{"id":"6a3803781b34ba74","repo":"pinpoint-apm/pinpoint","slug":"not-found-interceptorholderclass-classname-6a3803","errorCode":null,"errorMessage":"not found InterceptorHolderClass, className=","messagePattern":"not found InterceptorHolderClass, className=","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java","lineNumber":135,"sourceCode":"\n    private void init(Class<?> interceptorHolderClass, Supplier<Interceptor> supplier) throws InstrumentException {\n        try {\n            final Method method = interceptorHolderClass.getDeclaredMethod(\"set\", Supplier.class);\n            method.invoke(null, supplier);\n        } catch (NoSuchMethodException e) {\n            throw new InstrumentException(\"not found 'set' method, className=\" + interceptorHolderClass.getName(), e);\n        } catch (IllegalAccessException e) {\n            throw new InstrumentException(\"access fail, className=\" + interceptorHolderClass.getName(), e);\n        } catch (InvocationTargetException e) {\n            throw new InstrumentException(\"invocation fail, className=\" + interceptorHolderClass.getName(), e);\n        }\n    }\n\n    public Class<?> loadClass(ClassLoader classLoader) throws InstrumentException {\n        try {\n            return Class.forName(className, false, classLoader);\n        } catch (ClassNotFoundException e) {\n            throw new InstrumentException(\"not found InterceptorHolderClass, className=\" + className);\n        }\n    }\n\n    public Class<?> defineClass(ClassLoader classLoader) throws InstrumentException {\n        try {\n            final byte[] mainClassBytes = toMainClassByteArray();\n            final Class<?> mainClass = InterceptorDefineClassHelper.defineClass(classLoader, className, mainClassBytes);\n            final byte[] innerClassByte = toInnerClassByteArray();\n            InterceptorDefineClassHelper.defineClass(classLoader, innerClassName, innerClassByte);\n            return mainClass;\n        } catch (Exception e) {\n            throw new InstrumentException(\"defineClass fail\", e);\n        }\n    }\n\n    byte[] toMainClassByteArray() throws InstrumentException {\n        try {\n            ClassNode classNode = readClass(INTERCEPTOR_HOLDER_CLASS);","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java#L117-L153","documentation":"loadClass resolves the generated holder class name (com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorHolder$$N) via Class.forName(className, false, classLoader). This InstrumentException is thrown when the class is not yet defined in the given classloader — i.e. loadClass was called before defineClass, or the holder was defined into a different classloader.","triggerScenarios":"Calling loadInterceptorClass(classLoader) (which calls loadClass) without first calling defineClass for that classloader; or defining the holder into the bootstrap loader (classLoader==null path) but later loading it through an application classloader (or vice versa).","commonSituations":"Custom instrumentation code that builds the holder in one classloader and reads it from another; ordering bugs where loadInterceptorClass runs before Builder.build(); agent restart/shadow classloader mismatches.","solutions":["Call defineClass(classLoader) (or Builder.build()) before loadClass/loadInterceptorClass with the same ClassLoader instance","Ensure the same classloader used at define time is passed at load time — null maps to the bootstrap loader","Verify the agent's transformer pipeline initializes the holder before any code path reads it","Log holder class name and classloader identity on both define and load to spot mismatches"],"exampleFix":"// before\nASMInterceptorHolder holder = new ASMInterceptorHolder(id);\nClass<? extends Interceptor> c = holder.loadInterceptorClass(appClassLoader); // not defined yet\n// after\nholder.defineClass(appClassLoader);\nClass<? extends Interceptor> c = holder.loadInterceptorClass(appClassLoader);","handlingStrategy":"validation","validationCode":"// call defineClass/build first, then load with the same loader\nholder.defineClass(appClassLoader);\nClass<?> check = Class.forName(holder.getClassName(), false, appClassLoader); // must not throw","typeGuard":null,"tryCatchPattern":"try {\n    Class<?> c = holder.loadClass(appClassLoader);\n} catch (InstrumentException e) {\n    logger.error(\"holder {} not defined in this classloader; call defineClass first\", holder.getClassName());\n}","preventionTips":["Establish a strict order: create -> defineClass/build -> loadClass/init","Use the identical ClassLoader instance for define and load (null = bootstrap)","Never look up holder classes by name in classloaders that never had them defined"],"tags":["classloader","classnotfound","instrumentation"],"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"}