{"record":{"id":"b1377a25c6d51920","repo":"pinpoint-apm/pinpoint","slug":"not-found-get-method-classname","errorCode":null,"errorMessage":"not found 'get' method, className=","messagePattern":"not found 'get' method, className=","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java","lineNumber":104,"sourceCode":"    public Class<? extends Interceptor> loadInterceptorClass(ClassLoader classLoader) throws InstrumentException {\n        try {\n            final Class<?> clazz = loadClass(classLoader);\n            if (clazz == null) {\n                // defense code\n                throw new InstrumentException(\"not found interceptorHolderClass, className=\" + className);\n            }\n\n            final Method method = clazz.getDeclaredMethod(\"get\");\n            final Object o = method.invoke(null);\n            if (o instanceof Interceptor) {\n                return (Class<? extends Interceptor>) o.getClass();\n            } else {\n                throw new InstrumentException(\"not found interceptor, className=\" + className);\n            }\n        } catch (InvocationTargetException e) {\n            throw new InstrumentException(\"invocation fail, className=\" + className, e);\n        } catch (NoSuchMethodException e) {\n            throw new InstrumentException(\"not found 'get' method, className=\" + className, e);\n        } catch (IllegalAccessException e) {\n            throw new InstrumentException(\"access fail, className=\" + className, e);\n        }\n    }\n\n    public void init(Class<?> interceptorHolderClass, InterceptorFactory factory, Class<? extends Interceptor> interceptorClass, Object[] providedArguments, ScopeInfo scopeInfo, MethodDescriptor methodDescriptor) throws InstrumentException {\n        init(interceptorHolderClass, new InterceptorLazyLoadingSupplier(factory, interceptorClass, providedArguments, scopeInfo, methodDescriptor));\n    }\n\n    public void init(Class<?> interceptorHolderClass, Interceptor interceptor) throws InstrumentException {\n        init(interceptorHolderClass, new InterceptorSupplier(interceptor));\n    }\n\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) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java#L86-L122","documentation":"loadInterceptorClass looks up a declared static method named 'get' on the generated InterceptorHolder class via getDeclaredMethod(\"get\"). This InstrumentException is thrown when no such method exists, indicating the loaded class is not the expected generated InterceptorHolder shape (it should always expose static get()/set(Supplier) methods).","triggerScenarios":"Calling loadInterceptorClass(classLoader) when Class.forName resolved a different/older class under the generated name (e.g. a stale or duplicated InterceptorHolder$$N class in the target classloader), or the ASM byte-generation pipeline produced a class without the 'get' method.","commonSituations":"Agent re-injection conflicts where the holder class name collides with an existing class, a modified/patched Pinpoint build where the InterceptorHolder template changed, or loading via a child classloader that picked up a foreign class of the same name.","solutions":["Ensure agent is not loaded twice in the same JVM (check for duplicate pinpoint-bootstrap/profiler jars)","Verify the holder class being loaded was produced by defineClass from this same ASMInterceptorHolder build, not a stale copy","Check that the pinned ASM version matches the one Pinpoint was compiled against (ASMVersion)","If generating holders into an app classloader, confirm no application class shadows com.navercorp.pinpoint.profiler.instrument.interceptor.InterceptorHolder$$*"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Class<?> c = holder.loadClass(classLoader);\nboolean ok = false;\ntry { c.getDeclaredMethod(\"get\"); ok = true; } catch (NoSuchMethodException ignored) {}\nif (!ok) throw new IllegalStateException(\"not a generated InterceptorHolder: \" + c.getName());","typeGuard":null,"tryCatchPattern":"try {\n    Class<? extends Interceptor> c = holder.loadInterceptorClass(classLoader);\n} catch (InstrumentException e) {\n    logger.error(\"holder class {} lacks 'get' method — stale or duplicate class\", e.getMessage());\n}","preventionTips":["Never install the agent twice in one JVM","Generate and load holders only through ASMInterceptorHolder.defineClass, never by name lookup on untrusted classloaders","Keep ASM and agent versions consistent"],"tags":["reflection","classloader","interceptor"],"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"}