pinpoint-apm/pinpoint · error · RuntimeException
unsupported Interceptor Type. ${interceptorClazz.getName()}
Error message
unsupported Interceptor Type. ${interceptorClazz.getName()} What it means
RuntimeException thrown by InterceptorDefinitionFactory.createInterceptorDefinition when none of the registered TypeHandlers can resolve the interceptor class into a known InterceptorDefinition (BasicInterceptor, AroundInterceptor, etc.). The class compiles fine but its before/after method signature shape does not match any supported interceptor type.
Source
Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/interceptor/InterceptorDefinitionFactory.java:73
public class InterceptorDefinitionFactory {
private final Logger logger = LogManager.getLogger(this.getClass());
private final List<TypeHandler> detectHandlers;
public InterceptorDefinitionFactory() {
this.detectHandlers = register();
}
public InterceptorDefinition createInterceptorDefinition(Class<?> interceptorClazz) {
Objects.requireNonNull(interceptorClazz, "interceptorClazz");
for (TypeHandler typeHandler : detectHandlers) {
final InterceptorDefinition interceptorDefinition = typeHandler.resolveType(interceptorClazz);
if (interceptorDefinition != null) {
return interceptorDefinition;
}
}
throw new RuntimeException("unsupported Interceptor Type. " + interceptorClazz.getName());
}
private List<TypeHandler> register() {
final List<TypeHandler> typeHandlerList = new ArrayList<TypeHandler>();
addTypeHandler(typeHandlerList, AroundInterceptor.class, InterceptorType.ARRAY_ARGS);
addTypeHandler(typeHandlerList, AroundInterceptor0.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, AroundInterceptor1.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, AroundInterceptor2.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, AroundInterceptor3.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, AroundInterceptor4.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, AroundInterceptor5.class, InterceptorType.BASIC);
addTypeHandler(typeHandlerList, StaticAroundInterceptor.class, InterceptorType.STATIC);
addTypeHandler(typeHandlerList, ApiIdAwareAroundInterceptor.class, InterceptorType.API_ID_AWARE);
addTypeHandler(typeHandlerList, InjectedAsyncContextApiIdAwareAroundInterceptor.class, InterceptorType.ASYNC_CONTEXT_API_ID_AWARE);
addTypeHandler(typeHandlerList, ResultReplaceAroundInterceptor.class, InterceptorType.RESULT_REPLACE);
// block variant: before() returning TraceBlock switches the capture type to BLOCK_AROUND.View on GitHub (pinned to 744c3d3075)
Solutions
- Compare your interceptor's before/after signatures against a supported type (BasicInterceptor, AroundInterceptor, SpanInterceptor etc.) and align them exactly.
- Extend one of the adapter base classes (e.g. AroundInterceptor) rather than implementing Interceptor directly.
- Print the class's declared methods and check the expected 2-method contract (one before, one after).
- Verify the targetMethod/filter annotations match the interceptor type supported by your Pinpoint version.
Example fix
// before
class MyInterceptor implements Interceptor {
public void before(Object target, int a, String b, long c, boolean d) { ... }
}
// after
class MyInterceptor extends AroundInterceptor {
public MyInterceptor(TraceContext ctx, MethodDescriptor d) { super(ctx, d); }
protected void doInBeforeTrace(SpanEventRecorder r, Object t, Object[] args) { ... }
protected void doInAfterTrace(SpanEventRecorder r, Object target, Object[] args, Object result, Throwable th) { ... }
} Defensive patterns
Strategy: validation
Validate before calling
// ensure the class matches a supported shape before registration
long named = Arrays.stream(clazz.getDeclaredMethods())
.filter(m -> m.getName().equals("before") || m.getName().equals("after")).count();
if (named != 2) throw new IllegalArgumentException(clazz + " does not look like a supported interceptor"); Try / catch
try { InterceptorDefinition d = factory.createInterceptorDefinition(clazz); } catch (RuntimeException e) { if (e.getMessage().startsWith("unsupported Interceptor Type")) { /* align signature with a supported type */ } throw e; } Prevention
- Extend a supported base interceptor class instead of raw Interceptor
- Copy signatures from a built-in interceptor of the same type
- Pin the pinpoint plugin API dependency to the agent's version
When it happens
Trigger: Passing an interceptor Class to the factory whose method signature does not match any registered type handler's expected shape (wrong parameter count/types for before/after, wrong return types, or a class that only nominally implements Interceptor).
Common situations: Writing a custom interceptor with a hand-typed before()/after() signature that doesn't match a supported Pinpoint interceptor type, upgrading Pinpoint and dropping support for an old signature shape, or annotating the wrong class as an interceptor.
Related errors
- invalid Type
- invocation fail, className=
- not found 'set' method, className=
- result-replace interceptor requires an object or array retur
- ${methodName} not found
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/ea7dd68717e1b49e.
Report an issue: GitHub.