quarkusio/quarkus · error · java.lang.IllegalStateException
Trying to use a StorkClientRequestFilter but the quarkus-sma
Error message
Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.
What it means
StorkClientRequestFilter's constructor requires SmallRye Stork to be available via Stork.getInstance(); when it is null — or when instantiation throws, e.g. the Stork classes are absent — it throws this IllegalStateException telling you to add the quarkus-smallrye-stork extension. Stork is what resolves stork:// service URIs to real hosts.
Source
Thrown at independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/StorkClientRequestFilter.java:33
import org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestFilter;
import io.smallrye.mutiny.Multi;
import io.smallrye.stork.Stork;
@Priority(Priorities.AUTHENTICATION)
@Provider
public class StorkClientRequestFilter implements ResteasyReactiveClientRequestFilter {
private static final Logger log = Logger.getLogger(StorkClientRequestFilter.class);
private final Stork stork;
public StorkClientRequestFilter() {
try {
stork = Stork.getInstance();
if (stork == null) {
throw new IllegalStateException(
"Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.");
}
} catch (Exception e) {
throw new IllegalStateException(
"Trying to use a StorkClientRequestFilter but the quarkus-smallrye-stork extension is missing, please add the extension.");
}
}
@Override
public void filter(ResteasyReactiveClientRequestContext requestContext) {
URI uri = requestContext.getUri();
if (uri != null && uri.getScheme() != null && uri.getScheme().startsWith(Stork.STORK)) {
String serviceName = uri.getHost();
if (serviceName == null) { // invalid URI
throw new IllegalArgumentException("Invalid REST Client URL used: '" + uri + "'");
}
requestContext.suspend();View on GitHub (pinned to e1c734241f)
Solutions
- Add the quarkus-smallrye-stork extension dependency to the project
- Remove any stork:// URIs / StorkClientRequestFilter registration if service discovery is not wanted
- If relying on a service-discovery implementation, also add its dependency (e.g. quarkus-stork-kubernetes-service-discovery or Consul)
Example fix
// before <dependency> <groupId>io.quarkus</groupId><artifactId>quarkus-rest-client-reactive</artifactId> </dependency> // after <dependency> <groupId>io.quarkus</groupId><artifactId>quarkus-rest-client-reactive</artifactId> </dependency> <dependency> <groupId>io.quarkus</groupId><artifactId>quarkus-smallrye-stork</artifactId> </dependency>
Defensive patterns
Strategy: fallback
Validate before calling
// at startup
boolean storkAvailable;
try {
storkAvailable = io.smallrye.mutiny.infrastructure.Infrastructure // placeholder
== null || Class.forName("io.smallrye.stork.Stork") != null;
} catch (ClassNotFoundException e) {
storkAvailable = false;
}
if (!storkAvailable) throw new IllegalStateException("Add quarkus-smallrye-stork before using stork:// URIs"); Type guard
boolean isStorkConfigured(String uri) {
return uri != null && uri.startsWith("stork://");
}
// if true, the extension dependency must be present Try / catch
try {
filter = new StorkClientRequestFilter();
} catch (IllegalStateException e) {
if (e.getMessage().contains("quarkus-smallrye-stork")) {
log.error("Add io.quarkus:quarkus-smallrye-stork to use stork:// URIs");
} else throw e;
} Prevention
- Add quarkus-smallrye-stork whenever any client URI uses stork://
- Run a startup check that fails fast if Stork is required but absent
- Keep service-discovery provider dependencies alongside the Stork extension
When it happens
Trigger: Using a stork:// URL (or registering StorkClientRequestFilter) in an application whose classpath lacks the quarkus-smallrye-stork extension, so Stork.getInstance() returns null or throws.
Common situations: Configuring quarkus.rest-client.<key>.uri=stork://myservice without adding the extension; switching from a direct http:// URL to service discovery; running tests/native builds where the extension dependency was omitted.
Related errors
- No service definition for serviceName ${serviceName} found.
- Failed to determine working socket addresses for service-nam
- The application is using a Stork Consul provider but does no
- Invalid REST Client URL used: '<uri>'
- Assistant not available
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/b07410b67a736797.
Report an issue: GitHub.