{"record":{"id":"0a1dddd7aaa4b343","repo":"pinpoint-apm/pinpoint","slug":"invocation-fail-classname","errorCode":null,"errorMessage":"invocation fail, className=","messagePattern":"invocation fail, className=","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java","lineNumber":102,"sourceCode":"    }\n\n    public Class<? extends Interceptor> loadInterceptorClass(ClassLoader classLoader) throws InstrumentException {\n        try {\n            final Class<?> clazz = loadClass(classLoader);\n            if (clazz == null) {\n                // defense code\n                throw new InstrumentException(\"not found interceptorHolderClass, className=\" + className);\n            }\n\n            final Method method = clazz.getDeclaredMethod(\"get\");\n            final Object o = method.invoke(null);\n            if (o instanceof Interceptor) {\n                return (Class<? extends Interceptor>) o.getClass();\n            } else {\n                throw new InstrumentException(\"not found interceptor, className=\" + className);\n            }\n        } catch (InvocationTargetException e) {\n            throw new InstrumentException(\"invocation fail, className=\" + className, e);\n        } catch (NoSuchMethodException e) {\n            throw new InstrumentException(\"not found 'get' method, className=\" + className, e);\n        } catch (IllegalAccessException e) {\n            throw new InstrumentException(\"access fail, className=\" + className, e);\n        }\n    }\n\n    public void init(Class<?> interceptorHolderClass, InterceptorFactory factory, Class<? extends Interceptor> interceptorClass, Object[] providedArguments, ScopeInfo scopeInfo, MethodDescriptor methodDescriptor) throws InstrumentException {\n        init(interceptorHolderClass, new InterceptorLazyLoadingSupplier(factory, interceptorClass, providedArguments, scopeInfo, methodDescriptor));\n    }\n\n    public void init(Class<?> interceptorHolderClass, Interceptor interceptor) throws InstrumentException {\n        init(interceptorHolderClass, new InterceptorSupplier(interceptor));\n    }\n\n    private void init(Class<?> interceptorHolderClass, Supplier<Interceptor> supplier) throws InstrumentException {\n        try {\n            final Method method = interceptorHolderClass.getDeclaredMethod(\"set\", Supplier.class);","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMInterceptorHolder.java#L84-L120","documentation":"Pinpoint's ASMInterceptorHolder.loadInterceptorClass reflectively invokes the static 'get' method of a generated InterceptorHolder class to retrieve the interceptor instance. This InstrumentException wraps an InvocationTargetException, meaning the 'get' method itself (or the lazy-loading supplier it delegates to) threw an exception during invocation. The original cause is chained, so inspecting getCause() reveals the real failure inside interceptor creation or class initialization.","triggerScenarios":"Calling loadInterceptorClass(classLoader) after the generated holder class was defined, but the static InterceptorHolder$LazyLoading supplier throws while constructing the interceptor — e.g. the InterceptorFactory.newInterceptor call inside the supplier fails, or the holder's static initializer fails when 'get' first touches it.","commonSituations":"Interceptor constructor throws due to bad providedArguments (wrong arity/types), required runtime classes missing from the target application's classloader, or a plugin interceptor's constructor making assumptions (e.g. about the instrumented class) that do not hold.","solutions":["Read the chained cause (e.getCause()) — this message is only a wrapper; fix the underlying exception thrown during interceptor instantiation","Verify providedArguments match the interceptor constructor signature (count and types)","Confirm the interceptor class and all its dependencies are visible to the target classloader","Test the interceptor class standalone (instantiate with the same arguments) to reproduce the constructor failure"],"exampleFix":"// before\nObject[] args = new Object[]{targetClass}; // wrong arity\nbuilder.interceptorFactory(classLoader, factory, interceptorClass, args, scopeInfo, methodDescriptor);\n// after\nObject[] args = new Object[]{targetClass, methodDescriptor}; // match interceptor constructor\nbuilder.interceptorFactory(classLoader, factory, interceptorClass, args, scopeInfo, methodDescriptor);","handlingStrategy":"try-catch","validationCode":"// verify interceptor can be constructed before wiring\ntry {\n    Interceptor it = interceptorFactory.newInterceptor(interceptorClass, providedArguments, scopeInfo, methodDescriptor);\n    if (it == null) throw new IllegalStateException(\"interctor factory returned null\");\n} catch (Throwable t) {\n    throw new IllegalStateException(\"interceptor construction would fail: \" + t, t);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Class<? extends Interceptor> c = holder.loadInterceptorClass(classLoader);\n} catch (InstrumentException e) {\n    Throwable root = e.getCause();\n    logger.warn(\"interceptor invocation failed for {}, root cause:\", holder.getClassName(), root);\n    // fall back to no-op interceptor or disable the plugin\n}","preventionTips":["Always inspect getCause() — this exception is a reflective wrapper","Test interceptor constructors with the exact providedArguments before deployment","Ensure interceptor dependencies ship with the plugin and are visible to the target classloader"],"tags":["reflection","instrumentation","interceptor"],"backgroundTag":"internal-invariant-violation","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"}