quarkusio/quarkus · error · IllegalStateException
<RestClientRequestContext.INVOKED_METHOD_PROP> property must
Error message
<RestClientRequestContext.INVOKED_METHOD_PROP> property must not be null
What it means
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.
Source
Thrown at extensions/oidc-client-reactive-filter/runtime/src/main/java/io/quarkus/oidc/client/reactive/filter/runtime/AbstractOidcClientRequestReactiveFilter.java:106
}
private boolean accessTokenNeedsRefresh() {
return refreshOnUnauthorized() && accessTokenNeedsRefresh;
}
private boolean skipPropagation(ResteasyReactiveClientRequestContext requestContext) {
if (getMethodDescription() == null) {
return false;
}
return !getMethodDescription().equals(getInvokedRestClientMethodSignature(requestContext));
}
private static MethodDescription getInvokedRestClientMethodSignature(ResteasyReactiveClientRequestContext requestContext) {
if (requestContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP) instanceof Method method) {
return MethodDescription.ofMethod(method);
}
throw new IllegalStateException(RestClientRequestContext.INVOKED_METHOD_PROP + " property must not be null");
}
/**
* This method is overridden by generated filter classes if the filter should only be applied on the REST client
* method.
*
* @return REST client method description for which this filter should be applied; or null if applies to all methods
*/
protected MethodDescription getMethodDescription() {
return null;
}
}
View on GitHub (pinned to e1c734241f)
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.
Example fix
// before
mockContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP); // null
// after
when(mockContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP)).thenReturn(getClass().getMethod("call")); Defensive patterns
Strategy: type-guard
Validate before calling
Object prop = requestContext.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP);
if (!(prop instanceof Method invokedMethod)) {
throw new IllegalStateException("INVOKED_METHOD_PROP missing — ensure the request goes through the Quarkus REST Client proxy");
} Type guard
static boolean hasInvokedMethod(ClientRequestContext ctx) {
return ctx.getProperty(RestClientRequestContext.INVOKED_METHOD_PROP) instanceof Method;
} Try / catch
try {
proceedWithFilterChain(requestContext);
} catch (IllegalStateException e) {
if (String.valueOf(e.getMessage()).contains("INVOKED_METHOD_PROP")) {
// log: request context did not originate from a REST client proxy invocation
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- <INVOKED_METHOD_PROP> property must not be null
- Token exchange is required but OIDC client is configured to
- 'state' query parameter is not available
- Offending class is '${className}'
- Cannot reset a started application
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/506bd5b3496ea764.
Report an issue: GitHub.