pinpoint-apm/pinpoint · error · InstrumentException
not found 'get' method, className=
Error message
not found 'get' method, className=
What it means
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).
Source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java:104
public Class<? extends Interceptor> loadInterceptorClass(ClassLoader classLoader) throws InstrumentException {
try {
final Class<?> clazz = loadClass(classLoader);
if (clazz == null) {
// defense code
throw new InstrumentException("not found interceptorHolderClass, className=" + className);
}
final Method method = clazz.getDeclaredMethod("get");
final Object o = method.invoke(null);
if (o instanceof Interceptor) {
return (Class<? extends Interceptor>) o.getClass();
} else {
throw new InstrumentException("not found interceptor, className=" + className);
}
} catch (InvocationTargetException e) {
throw new InstrumentException("invocation fail, className=" + className, e);
} catch (NoSuchMethodException e) {
throw new InstrumentException("not found 'get' method, className=" + className, e);
} catch (IllegalAccessException e) {
throw new InstrumentException("access fail, className=" + className, e);
}
}
public void init(Class<?> interceptorHolderClass, InterceptorFactory factory, Class<? extends Interceptor> interceptorClass, Object[] providedArguments, ScopeInfo scopeInfo, MethodDescriptor methodDescriptor) throws InstrumentException {
init(interceptorHolderClass, new InterceptorLazyLoadingSupplier(factory, interceptorClass, providedArguments, scopeInfo, methodDescriptor));
}
public void init(Class<?> interceptorHolderClass, Interceptor interceptor) throws InstrumentException {
init(interceptorHolderClass, new InterceptorSupplier(interceptor));
}
private void init(Class<?> interceptorHolderClass, Supplier<Interceptor> supplier) throws InstrumentException {
try {
final Method method = interceptorHolderClass.getDeclaredMethod("set", Supplier.class);
method.invoke(null, supplier);
} catch (NoSuchMethodException e) {View on GitHub (pinned to 744c3d3075)
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$$*
Defensive patterns
Strategy: try-catch
Validate before calling
Class<?> c = holder.loadClass(classLoader);
boolean ok = false;
try { c.getDeclaredMethod("get"); ok = true; } catch (NoSuchMethodException ignored) {}
if (!ok) throw new IllegalStateException("not a generated InterceptorHolder: " + c.getName()); Try / catch
try {
Class<? extends Interceptor> c = holder.loadInterceptorClass(classLoader);
} catch (InstrumentException e) {
logger.error("holder class {} lacks 'get' method — stale or duplicate class", e.getMessage());
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- initialize fail Caused by:
- invoke fail Caused by:
- bootstrapClassLoader not found Caused by:
- boot method invoke failed. Error:
- execute fail. Error:
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/b1377a25c6d51920.
Report an issue: GitHub.