{"record":{"id":"e75ba136c45c9f3d","repo":"quarkusio/quarkus","slug":"intercepted-method-metadata-not-found-for-key","errorCode":null,"errorMessage":"Intercepted method metadata not found for key: ","messagePattern":"Intercepted method metadata not found for key: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InterceptedStaticMethods.java","lineNumber":20,"sourceCode":"\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentMap;\n\npublic final class InterceptedStaticMethods {\n\n    private static final ConcurrentMap<String, InterceptedMethodMetadata> METADATA = new ConcurrentHashMap<>();\n\n    private InterceptedStaticMethods() {\n    }\n\n    public static void register(String key, InterceptedMethodMetadata metadata) {\n        METADATA.putIfAbsent(key, metadata);\n    }\n\n    public static Object aroundInvoke(String key, Object[] args) throws Exception {\n        InterceptedMethodMetadata metadata = METADATA.get(key);\n        if (metadata == null) {\n            throw new IllegalArgumentException(\"Intercepted method metadata not found for key: \" + key);\n        }\n        return InvocationContexts.performAroundInvoke(null, args, metadata);\n    }\n\n    static void clear() {\n        METADATA.clear();\n    }\n\n}\n","sourceCodeStart":2,"sourceCodeEnd":30,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InterceptedStaticMethods.java#L2-L30","documentation":"ArC's InterceptedStaticMethods registry looks up pre-computed InterceptedMethodMetadata by a string key before performing an intercepted static method invocation. If the key has no entry, the container was not initialized for that method (the metadata is registered during bean deployment) or a stale/incorrect key was passed. This indicates a container wiring or generated-code mismatch rather than a normal user error.","triggerScenarios":"Calling InterceptedStaticMethods.aroundInvoke(key, args) with a key that was never registered via register() (e.g. key produced by code generated against a different deployment, or the archive was reloaded without re-registering metadata).","commonSituations":"Hot-reload/live-reload (dev mode) after changing an intercepted static method where the generated call site key no longer matches registered metadata; mixing versions of generated and runtime classes; invoking intercepted static methods before the ArC container finished initialization.","solutions":["Rebuild the application so generated interceptor metadata and call sites are consistent (mvn clean install).","Restart the dev-mode/live-reload cycle so the container re-runs deployment and re-registers metadata.","Check that the same Quarkus/ArC version is used at compile time and runtime (no mixed jars on the classpath).","Verify the key string passed to aroundInvoke matches the one generated at build time (do not hand-craft keys)."],"exampleFix":"// before: stale key from old generated code\nInterceptedStaticMethods.aroundInvoke(\"com.acme.Foo$$staticInterc1\", args);\n// after: rebuild; generated call site uses the key registered in the current deployment\nInterceptedStaticMethods.aroundInvoke(generatedKey, args);","handlingStrategy":"validation","validationCode":"// ensure container is running and metadata registered before invoking intercepted statics\nif (Arc.container() == null || !Arc.container().isRunning()) {\n    throw new IllegalStateException(\"ArC container not started; intercepted static method unavailable\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return InterceptedStaticMethods.aroundInvoke(key, args);\n} catch (IllegalArgumentException e) {\n    // metadata missing: force redeploy/reinit instead of retrying the same stale key\n    throw new IllegalStateException(\"Stale intercepted-static key \" + key + \" — rebuild/redeploy\", e);\n}","preventionTips":["Never hand-craft intercepted-static keys; rely on build-time generated call sites","Rebuild (clean) after changing intercepted static methods in dev mode","Keep compile-time and runtime Quarkus/ArC versions identical"],"tags":["cdi","arquillian-arc","interceptor","generated-code"],"backgroundTag":"interceptor-metadata-not-registered","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}