pinpoint-apm/pinpoint · error · InstrumentException

not found interceptor, className=

Error message

not found interceptor, className=

What it means

After loading the interceptor holder class, loadInterceptorClass() invokes its static get() method and expects the result to be an Interceptor instance. If the returned object is not an Interceptor, it throws InstrumentException 'not found interceptor, className=...'. The holder class was found but does not expose a valid interceptor via get().

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java:99

    public String getClassName() {
        return className;
    }

    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));
    }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Ensure get() returns an instance of the Interceptor interface
  2. Verify the holder class is the intended interceptor class, not an unrelated class
  3. Check that the Interceptor interface is loaded by the same classloader as the returned object (classloader identity matters for instanceof)
  4. Regenerate the holder class with the current agent tooling if it was produced by an older version

Example fix

// before
public static Object get() { return new NotAnInterceptor(); }
// after
public static Interceptor get() { return new MyInterceptor(); }
Defensive patterns

Strategy: validation

Validate before calling

Object o = holderClass.getMethod("get").invoke(null);
if (!(o instanceof Interceptor)) {
    throw new IllegalStateException(holderClass.getName() + ".get() does not return an Interceptor");
}

Try / catch

try {
    Class<? extends Interceptor> c = holder.interceptorClass(classLoader);
} catch (InstrumentException e) {
    logger.warn("{} does not provide an Interceptor", className, e);
}

Prevention

When it happens

Trigger: Holder class's static get() returns an object that fails the instanceof Interceptor check (returns null or an unrelated type).

Common situations: Wrong class registered as an interceptor holder; holder class refactored so get() returns something else; class version mismatch between agent and plugin where the Interceptor interface differs across classloaders (instanceof fails due to different ClassLoaders).

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/3d346e30feeb913c. Report an issue: GitHub.