pinpoint-apm/pinpoint · error · InstrumentException
invocation fail, className=
Error message
invocation fail, className=
What it means
Pinpoint's ASMInterceptorHolder.loadInterceptorClass reflectively invokes the static 'get' method of a generated InterceptorHolder class to retrieve the interceptor instance. This InstrumentException wraps an InvocationTargetException, meaning the 'get' method itself (or the lazy-loading supplier it delegates to) threw an exception during invocation. The original cause is chained, so inspecting getCause() reveals the real failure inside interceptor creation or class initialization.
Solutions
- Read the chained cause (e.getCause()) — this message is only a wrapper; fix the underlying exception thrown during interceptor instantiation
- Verify providedArguments match the interceptor constructor signature (count and types)
- Confirm the interceptor class and all its dependencies are visible to the target classloader
- Test the interceptor class standalone (instantiate with the same arguments) to reproduce the constructor failure
Example fix
// before
Object[] args = new Object[]{targetClass}; // wrong arity
builder.interceptorFactory(classLoader, factory, interceptorClass, args, scopeInfo, methodDescriptor);
// after
Object[] args = new Object[]{targetClass, methodDescriptor}; // match interceptor constructor
builder.interceptorFactory(classLoader, factory, interceptorClass, args, scopeInfo, methodDescriptor); Defensive patterns
Strategy: try-catch
Validate before calling
// verify interceptor can be constructed before wiring
try {
Interceptor it = interceptorFactory.newInterceptor(interceptorClass, providedArguments, scopeInfo, methodDescriptor);
if (it == null) throw new IllegalStateException("interctor factory returned null");
} catch (Throwable t) {
throw new IllegalStateException("interceptor construction would fail: " + t, t);
} Try / catch
try {
Class<? extends Interceptor> c = holder.loadInterceptorClass(classLoader);
} catch (InstrumentException e) {
Throwable root = e.getCause();
logger.warn("interceptor invocation failed for {}, root cause:", holder.getClassName(), root);
// fall back to no-op interceptor or disable the plugin
} Prevention
- Always inspect getCause() — this exception is a reflective wrapper
- Test interceptor constructors with the exact providedArguments before deployment
- Ensure interceptor dependencies ship with the plugin and are visible to the target classloader
When it happens
Trigger: Calling loadInterceptorClass(classLoader) after the generated holder class was defined, but the static InterceptorHolder$LazyLoading supplier throws while constructing the interceptor — e.g. the InterceptorFactory.newInterceptor call inside the supplier fails, or the holder's static initializer fails when 'get' first touches it.
Common situations: Interceptor constructor throws due to bad providedArguments (wrong arity/types), required runtime classes missing from the target application's classloader, or a plugin interceptor's constructor making assumptions (e.g. about the instrumented class) that do not hold.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- method not found.
- not found 'set' method, className=
- must return java.lang.Object.
- method not found.
- define fail cl: Caused by
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/0a1dddd7aaa4b343.
Report an issue: GitHub.
Appendix: source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java:102
}
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);View on GitHub (pinned to 744c3d3075)