{"record":{"id":"ea7dd68717e1b49e","repo":"pinpoint-apm/pinpoint","slug":"unsupported-interceptor-type-interceptorclazz-g","errorCode":null,"errorMessage":"unsupported Interceptor Type. ${interceptorClazz.getName()}","messagePattern":"unsupported Interceptor Type\\. (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/interceptor/InterceptorDefinitionFactory.java","lineNumber":73,"sourceCode":"public class InterceptorDefinitionFactory {\n\n    private final Logger logger = LogManager.getLogger(this.getClass());\n    private final List<TypeHandler> detectHandlers;\n\n    public InterceptorDefinitionFactory() {\n        this.detectHandlers = register();\n    }\n\n    public InterceptorDefinition createInterceptorDefinition(Class<?> interceptorClazz) {\n        Objects.requireNonNull(interceptorClazz, \"interceptorClazz\");\n\n        for (TypeHandler typeHandler : detectHandlers) {\n            final InterceptorDefinition interceptorDefinition = typeHandler.resolveType(interceptorClazz);\n            if (interceptorDefinition != null) {\n                return interceptorDefinition;\n            }\n        }\n        throw new RuntimeException(\"unsupported Interceptor Type. \" + interceptorClazz.getName());\n    }\n\n\n    private List<TypeHandler> register() {\n        final List<TypeHandler> typeHandlerList = new ArrayList<TypeHandler>();\n\n        addTypeHandler(typeHandlerList, AroundInterceptor.class, InterceptorType.ARRAY_ARGS);\n        addTypeHandler(typeHandlerList, AroundInterceptor0.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, AroundInterceptor1.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, AroundInterceptor2.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, AroundInterceptor3.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, AroundInterceptor4.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, AroundInterceptor5.class, InterceptorType.BASIC);\n        addTypeHandler(typeHandlerList, StaticAroundInterceptor.class, InterceptorType.STATIC);\n        addTypeHandler(typeHandlerList, ApiIdAwareAroundInterceptor.class, InterceptorType.API_ID_AWARE);\n        addTypeHandler(typeHandlerList, InjectedAsyncContextApiIdAwareAroundInterceptor.class, InterceptorType.ASYNC_CONTEXT_API_ID_AWARE);\n        addTypeHandler(typeHandlerList, ResultReplaceAroundInterceptor.class, InterceptorType.RESULT_REPLACE);\n        // block variant: before() returning TraceBlock switches the capture type to BLOCK_AROUND.","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/interceptor/InterceptorDefinitionFactory.java#L55-L91","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\nclass MyInterceptor implements Interceptor {\n    public void before(Object target, int a, String b, long c, boolean d) { ... }\n}\n// after\nclass MyInterceptor extends AroundInterceptor {\n    public MyInterceptor(TraceContext ctx, MethodDescriptor d) { super(ctx, d); }\n    protected void doInBeforeTrace(SpanEventRecorder r, Object t, Object[] args) { ... }\n    protected void doInAfterTrace(SpanEventRecorder r, Object target, Object[] args, Object result, Throwable th) { ... }\n}","handlingStrategy":"validation","validationCode":"// ensure the class matches a supported shape before registration\nlong named = Arrays.stream(clazz.getDeclaredMethods())\n    .filter(m -> m.getName().equals(\"before\") || m.getName().equals(\"after\")).count();\nif (named != 2) throw new IllegalArgumentException(clazz + \" does not look like a supported interceptor\");","typeGuard":null,"tryCatchPattern":"try { InterceptorDefinition d = factory.createInterceptorDefinition(clazz); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"unsupported Interceptor Type\")) { /* align signature with a supported type */ } throw e; }","preventionTips":["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"],"tags":["interceptor","instrumentation","pinpoint","type-resolution"],"backgroundTag":"unsupported-interceptor-type","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"}