quarkusio/quarkus · error · IllegalArgumentException

Intercepted method metadata not found for key:

Error message

Intercepted method metadata not found for key: 

What it means

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.

Source

Thrown at independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InterceptedStaticMethods.java:20

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public final class InterceptedStaticMethods {

    private static final ConcurrentMap<String, InterceptedMethodMetadata> METADATA = new ConcurrentHashMap<>();

    private InterceptedStaticMethods() {
    }

    public static void register(String key, InterceptedMethodMetadata metadata) {
        METADATA.putIfAbsent(key, metadata);
    }

    public static Object aroundInvoke(String key, Object[] args) throws Exception {
        InterceptedMethodMetadata metadata = METADATA.get(key);
        if (metadata == null) {
            throw new IllegalArgumentException("Intercepted method metadata not found for key: " + key);
        }
        return InvocationContexts.performAroundInvoke(null, args, metadata);
    }

    static void clear() {
        METADATA.clear();
    }

}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Rebuild the application so generated interceptor metadata and call sites are consistent (mvn clean install).
  2. Restart the dev-mode/live-reload cycle so the container re-runs deployment and re-registers metadata.
  3. Check that the same Quarkus/ArC version is used at compile time and runtime (no mixed jars on the classpath).
  4. Verify the key string passed to aroundInvoke matches the one generated at build time (do not hand-craft keys).

Example fix

// before: stale key from old generated code
InterceptedStaticMethods.aroundInvoke("com.acme.Foo$$staticInterc1", args);
// after: rebuild; generated call site uses the key registered in the current deployment
InterceptedStaticMethods.aroundInvoke(generatedKey, args);
Defensive patterns

Strategy: validation

Validate before calling

// ensure container is running and metadata registered before invoking intercepted statics
if (Arc.container() == null || !Arc.container().isRunning()) {
    throw new IllegalStateException("ArC container not started; intercepted static method unavailable");
}

Try / catch

try {
    return InterceptedStaticMethods.aroundInvoke(key, args);
} catch (IllegalArgumentException e) {
    // metadata missing: force redeploy/reinit instead of retrying the same stale key
    throw new IllegalStateException("Stale intercepted-static key " + key + " — rebuild/redeploy", e);
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/e75ba136c45c9f3d. Report an issue: GitHub.