{"record":{"id":"506bd5b3496ea764","repo":"quarkusio/quarkus","slug":"restclientrequestcontext-invoked-method-prop-pro","errorCode":null,"errorMessage":"<RestClientRequestContext.INVOKED_METHOD_PROP> property must not be null","messagePattern":"<RestClientRequestContext\\.INVOKED_METHOD_PROP> property must not be null","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/oidc-client-reactive-filter/runtime/src/main/java/io/quarkus/oidc/client/reactive/filter/runtime/AbstractOidcClientRequestReactiveFilter.java","lineNumber":106,"sourceCode":"    }\n\n    private boolean accessTokenNeedsRefresh() {\n        return refreshOnUnauthorized() && accessTokenNeedsRefresh;\n    }\n\n    private boolean skipPropagation(ResteasyReactiveClientRequestContext requestContext) {\n        if (getMethodDescription() == null) {\n            return false;\n        }\n\n        return !getMethodDescription().equals(getInvokedRestClientMethodSignature(requestContext));\n    }\n\n    private static MethodDescription getInvokedRestClientMethodSignature(ResteasyReactiveClientRequestContext requestContext) {\n        if (requestContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP) instanceof Method method) {\n            return MethodDescription.ofMethod(method);\n        }\n        throw new IllegalStateException(RestClientRequestContext.INVOKED_METHOD_PROP + \" property must not be null\");\n    }\n\n    /**\n     * This method is overridden by generated filter classes if the filter should only be applied on the REST client\n     * method.\n     *\n     * @return REST client method description for which this filter should be applied; or null if applies to all methods\n     */\n    protected MethodDescription getMethodDescription() {\n        return null;\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":119,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/oidc-client-reactive-filter/runtime/src/main/java/io/quarkus/oidc/client/reactive/filter/runtime/AbstractOidcClientRequestReactiveFilter.java#L88-L119","documentation":"The OIDC client reactive filter inspects the current REST Client invocation by reading the INVOKED_METHOD_PROP property from the ResteasyReactiveClientRequestContext. This property is set by the REST Client runtime for each invocation; when it is absent or not a Method, the filter cannot determine which client method was invoked and throws IllegalStateException.","triggerScenarios":"The filter runs on a request context created outside the normal REST Client proxy invocation path — e.g. programmatically invoking the filter chain, a ClientBuilder-constructed client not managed by Quarkus REST Client Reactive, or a REST Client version mismatch where INVOKED_METHOD_PROP is never populated.","commonSituations":"Mixing incompatible rest-client-reactive and oidc-client-reactive-filter versions; applying an @RegisterTokenFilter-style filter to a manually created client; testing the filter with a mocked ClientRequestContext that never sets the property.","solutions":["Align quarkus-rest-client-reactive and quarkus-oidc-client-reactive-filter to the same Quarkus version (dependency:tree for conflicts).","Use the Quarkus-injected REST client interface (@RegisterRestClient) instead of a manually built client so the invocation property is set.","Remove the OIDC filter from manually configured clients; configure the token via the Quarkus OIDC client properties instead.","In tests, set the INVOKED_METHOD_PROP property on the mocked request context to the invoked Method."],"exampleFix":"// before\nmockContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP); // null\n// after\nwhen(mockContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP)).thenReturn(getClass().getMethod(\"call\"));","handlingStrategy":"type-guard","validationCode":"Object prop = requestContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP);\nif (!(prop instanceof Method invokedMethod)) {\n    throw new IllegalStateException(\"INVOKED_METHOD_PROP missing — ensure the request goes through the Quarkus REST Client proxy\");\n}","typeGuard":"static boolean hasInvokedMethod(ClientRequestContext ctx) {\n    return ctx.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP) instanceof Method;\n}","tryCatchPattern":"try {\n    proceedWithFilterChain(requestContext);\n} catch (IllegalStateException e) {\n    if (String.valueOf(e.getMessage()).contains(\"INVOKED_METHOD_PROP\")) {\n        // log: request context did not originate from a REST client proxy invocation\n    } else {\n        throw e;\n    }\n}","preventionTips":["Only attach OIDC reactive filters to clients created via @RegisterRestClient / Quarkus-managed proxies.","Keep rest-client-reactive and oidc-client-reactive-filter versions aligned.","Do not test the filter with bare mock contexts unless you set INVOKED_METHOD_PROP."],"tags":["rest-client","oidc","filter","state"],"backgroundTag":"invocation-context-missing","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}