{"record":{"id":"5beec42c902d29f6","repo":"pinpoint-apm/pinpoint","slug":"interceptorclassname-not-found-caused-by-ex-g","errorCode":null,"errorMessage":"${interceptorClassName} not found Caused by:${ex.getMessage()}","messagePattern":"(.+?) not found Caused by:(.+?)","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":382,"sourceCode":"                    logger.debug(\"Skip addSetter, setter already declared. class={}, setter={}\", getName(), setterClass.getName());\n                }\n            } catch (Exception e) {\n                if (finalRemoved) {\n                    fieldNode.setAccess(original);\n                }\n                throw e;\n            }\n        } catch (Exception e) {\n            throw new InstrumentException(\"Failed to add setter: \" + setterClass.getName(), e);\n        }\n    }\n\n    private Class<? extends Interceptor> loadInterceptorClass(String interceptorClassName) throws InstrumentException {\n        try {\n            final ClassLoader classLoader = classNode.getClassLoader();\n            return this.pluginContext.injectClass(classLoader, interceptorClassName);\n        } catch (Exception ex) {\n            throw new InstrumentException(interceptorClassName + \" not found Caused by:\" + ex.getMessage(), ex);\n        }\n    }\n\n\n    private int addInterceptor0(Class<? extends Interceptor> interceptorClass, Object[] constructorArgs, InterceptorScope scope, ExecutionPolicy executionPolicy) throws InstrumentException {\n        int interceptorId = -1;\n\n        final TargetMethods targetMethods = interceptorClass.getAnnotation(TargetMethods.class);\n        if (targetMethods != null) {\n            for (TargetMethod m : targetMethods.value()) {\n                interceptorId = addInterceptor0(m, interceptorClass, constructorArgs, scope, executionPolicy);\n            }\n        }\n\n        final TargetMethod targetMethod = interceptorClass.getAnnotation(TargetMethod.class);\n        if (targetMethod != null) {\n            interceptorId = addInterceptor0(targetMethod, interceptorClass, constructorArgs, scope, executionPolicy);\n        }","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L364-L400","documentation":"loadInterceptorClass loads an interceptor class into the target classloader via pluginContext.injectClass and wraps any failure into an InstrumentException stating '<interceptorClassName> not found'. This usually means the interceptor class is not visible to the target application's classloader, not that it is absent from the agent jar.","triggerScenarios":"addInterceptor/addScopedInterceptor is called with an interceptor class name that injectClass cannot load into classNode.getClassLoader(); any Exception from injectClass is converted to this message.","commonSituations":"Interceptor class not packaged in the plugin jar; classloader visibility issues (bootstrap vs app classloader); typo in the interceptor class name; plugin not deployed in the agent's plugin directory.","solutions":["Ensure the interceptor class is packaged in the plugin jar deployed to the agent's plugin directory","Check the interceptor class name for typos and correct package","Inspect the cause message: if ClassNotFoundException, fix packaging/classloader visibility; if linkage errors, fix dependencies","Verify the target classloader can see plugin classes (use Pinpoint's classloader rules or move the class to a visible location)"],"exampleFix":"// before\nclazz.addScopedInterceptor(\"com.example.Mynterceptor\", SCOPE); // typo\n// after\nclazz.addScopedInterceptor(\"com.example.MyInterceptor\", SCOPE);","handlingStrategy":"try-catch","validationCode":"try {\n    Class.forName(interceptorClassName, false, pluginClassLoader);\n} catch (ClassNotFoundException e) { /* fix packaging before deploying */ }","typeGuard":null,"tryCatchPattern":"try {\n    clazz.addInterceptor(interceptorClassName);\n} catch (InstrumentException e) {\n    logger.warn(\"interceptor {} not loadable: {}\", interceptorClassName, e.getMessage());\n}","preventionTips":["Verify plugin jar contents with jar tf before deploy","Deploy plugin jars to the agent plugin directory","Keep interceptor names in constants, not inline strings"],"tags":["java","classloading","plugin"],"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"}