{"record":{"id":"3dff8a230d20a0d0","repo":"pinpoint-apm/pinpoint","slug":"no-target-is-specified-at-least-one-of-targets","errorCode":null,"errorMessage":"No target is specified. At least one of @Targets, @TargetMethod, @TargetConstructor, @TargetFilter must present. interceptor: ${interceptorClassName}","messagePattern":"No target is specified\\. At least one of @Targets, @TargetMethod, @TargetConstructor, @TargetFilter must present\\. interceptor: (.+?)","errorType":"exception","errorClass":"PinpointException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":420,"sourceCode":"        final TargetConstructors targetConstructors = interceptorClass.getAnnotation(TargetConstructors.class);\n        if (targetConstructors != null) {\n            for (TargetConstructor c : targetConstructors.value()) {\n                interceptorId = addInterceptor0(c, interceptorClass, scope, executionPolicy, constructorArgs);\n            }\n        }\n\n        final TargetConstructor targetConstructor = interceptorClass.getAnnotation(TargetConstructor.class);\n        if (targetConstructor != null) {\n            interceptorId = addInterceptor0(targetConstructor, interceptorClass, scope, executionPolicy, constructorArgs);\n        }\n\n        final TargetFilter targetFilter = interceptorClass.getAnnotation(TargetFilter.class);\n        if (targetFilter != null) {\n            interceptorId = addInterceptor0(targetFilter, interceptorClass, scope, executionPolicy, constructorArgs);\n        }\n\n        if (interceptorId == -1) {\n            throw new PinpointException(\"No target is specified. At least one of @Targets, @TargetMethod, @TargetConstructor, @TargetFilter must present. interceptor: \" + interceptorClass.getName());\n        }\n\n        return interceptorId;\n    }\n\n    private int addInterceptor0(TargetConstructor c, Class<? extends Interceptor> interceptorClass, InterceptorScope scope, ExecutionPolicy executionPolicy, Object... constructorArgs) throws InstrumentException {\n        final InstrumentMethod constructor = getConstructor(c.value());\n\n        if (constructor == null) {\n            throw new NotFoundInstrumentException(\"Cannot find constructor with parameter types: \" + Arrays.toString(c.value()));\n        }\n        // TODO casting fix\n        return ((ASMMethod) constructor).addInterceptorInternal(interceptorClass, constructorArgs, scope, executionPolicy);\n    }\n\n    private int addInterceptor0(TargetMethod m, Class<? extends Interceptor> interceptorClass, Object[] constructorArgs, InterceptorScope scope, ExecutionPolicy executionPolicy) throws InstrumentException {\n        InstrumentMethod method = getDeclaredMethod(m.name(), m.paramTypes());\n","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L402-L438","documentation":"addInterceptor0 requires the interceptor class to declare at least one targeting annotation: @Targets, @TargetMethod, @TargetConstructor, or @TargetFilter. If none of these annotations are present, the interceptor id stays -1 and a PinpointException is thrown. This is a plugin metadata validation, not a runtime weaving failure.","triggerScenarios":"Calling addInterceptor/addScopedInterceptor with an interceptor Class that has none of @Targets/@TargetMethod/@TargetConstructor/@TargetFilter annotations.","commonSituations":"Plugin authors forget to annotate the interceptor; annotations placed on the wrong class; refactor renames that dropped annotations; hand-built interceptor registration without base annotations.","solutions":["Annotate the interceptor class with @TargetMethod, @TargetConstructor, @TargetFilter or @Targets","If registering programmatically, use the API overloads that accept explicit method/constructor targets","Review the plugin's interceptor classes for missing annotations after refactoring"],"exampleFix":"// before\npublic class MyInterceptor implements AroundInterceptor { ... }\n// after\n@TargetMethod(name = \"doGet\", paramTypes = {\"javax.servlet.http.HttpServletRequest\", \"javax.servlet.http.HttpServletResponse\"})\npublic class MyInterceptor implements AroundInterceptor { ... }","handlingStrategy":"validation","validationCode":"if (!(ic.getClass().isAnnotationPresent(Targets.class) || ic.getClass().isAnnotationPresent(TargetMethod.class) || ic.getClass().isAnnotationPresent(TargetConstructor.class) || ic.getClass().isAnnotationPresent(TargetFilter.class))) {\n    throw new IllegalStateException(ic.getName() + \" lacks a target annotation\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Annotate every interceptor with one of the target annotations","Add a unit test asserting each interceptor class has a target annotation","Re-check annotations after refactors"],"tags":["java","pinpoint-plugin","annotation"],"backgroundTag":"missing-required-argument","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"}