{"record":{"id":"3b4a761ebddb5f0d","repo":"pinpoint-apm/pinpoint","slug":"cannot-find-constructor-with-parameter-types-co","errorCode":null,"errorMessage":"Cannot find constructor with parameter types: ${constructorParamTypes}","messagePattern":"Cannot find constructor with parameter types: (.+?)","errorType":"exception","errorClass":"NotFoundInstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":430,"sourceCode":"        }\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\n        if (method == null) {\n            throw new NotFoundInstrumentException(\"Cannot find method \" + m.name() + \" with parameter types: \" + Arrays.toString(m.paramTypes()));\n        }\n        // TODO casting fix\n        return ((ASMMethod) method).addInterceptorInternal(interceptorClass, constructorArgs, scope, executionPolicy);\n    }\n\n    private int addInterceptor0(TargetFilter annotation, Class<? extends Interceptor> interceptorClass, InterceptorScope scope, ExecutionPolicy executionPolicy, Object[] constructorArgs) throws InstrumentException {\n        final String filterTypeName = annotation.type();\n        Objects.requireNonNull(filterTypeName, \"type of @TargetFilter\");","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L412-L448","documentation":"When an interceptor uses @TargetConstructor, addInterceptor0 looks up a constructor in the target class matching the declared parameter types via getConstructor(). If no constructor matches, a NotFoundInstrumentException is thrown listing the requested parameter types. The transform cannot proceed because there is nothing to attach the interceptor to.","triggerScenarios":"addInterceptor with @TargetConstructor whose value() describes a constructor signature that does not exist in the target class; getConstructor(c.value()) returns null.","commonSituations":"Library version change altered the constructor signature; wrong paramTypes strings (class names not matching the loaded class); targeting a class that only has a default constructor while specifying parameters.","solutions":["Update the @TargetConstructor paramTypes to match the actual constructor of the target library version","Verify the signature with javap -p on the target class","Use @TargetFilter or method targeting instead if the constructor is unstable across versions"],"exampleFix":"// before\n@TargetConstructor({\"java.lang.String\", \"java.lang.Integer\"})\n// after\n@TargetConstructor({\"java.lang.String\", \"int\"})","handlingStrategy":"validation","validationCode":"for (Constructor<?> c : targetClass.getDeclaredConstructors()) {\n    // compare c.getParameterTypes() with @TargetConstructor value before registering\n}","typeGuard":null,"tryCatchPattern":"try {\n    clazz.addInterceptor(interceptorClass);\n} catch (NotFoundInstrumentException e) {\n    logger.warn(\"constructor signature changed: {}\", e.getMessage());\n}","preventionTips":["Verify constructor signatures with javap on the pinned library version","Pin the instrumented library version in tests","Prefer @TargetFilter for version-tolerant matching"],"tags":["java","pinpoint-plugin","constructor"],"backgroundTag":"entity-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}