quarkusio/quarkus · critical · IllegalStateException

REST Data Panache can only work if 'quarkus-rest' or 'quarku

Error message

REST Data Panache can only work if 'quarkus-rest' or 'quarkus-resteasy' is present

What it means

RestDataProcessor.supportingBuildItems verifies at build time that a JAX-RS implementation is present. REST Data Panache generates REST resources on top of either RESTEasy Classic (quarkus-resteasy) or RESTEasy Reactive (quarkus-rest); if neither capability is on the classpath it throws IllegalStateException because there is no runtime to host the generated endpoints.

Source

Thrown at extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/RestDataProcessor.java:41

import io.quarkus.rest.data.panache.runtime.sort.SortQueryParamFilter;
import io.quarkus.rest.data.panache.runtime.sort.SortQueryParamValidator;
import io.quarkus.resteasy.common.spi.ResteasyJaxrsProviderBuildItem;
import io.quarkus.resteasy.reactive.spi.ContainerRequestFilterBuildItem;
import io.quarkus.resteasy.reactive.spi.GeneratedJaxRsResourceBuildItem;
import io.quarkus.resteasy.reactive.spi.GeneratedJaxRsResourceGizmoAdaptor;

public class RestDataProcessor {

    @BuildStep
    void supportingBuildItems(Capabilities capabilities,
            BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClassBuildItemBuildProducer,
            BuildProducer<ResteasyJaxrsProviderBuildItem> resteasyJaxrsProviderBuildItemBuildProducer,
            BuildProducer<ContainerRequestFilterBuildItem> containerRequestFilterBuildItemBuildProducer) {
        boolean isResteasyClassicAvailable = capabilities.isPresent(Capability.RESTEASY);
        boolean isResteasyReactiveAvailable = capabilities.isPresent(Capability.RESTEASY_REACTIVE);

        if (!isResteasyClassicAvailable && !isResteasyReactiveAvailable) {
            throw new IllegalStateException(
                    "REST Data Panache can only work if 'quarkus-rest' or 'quarkus-resteasy' is present");
        }

        if (isResteasyClassicAvailable) {
            runtimeInitializedClassBuildItemBuildProducer
                    .produce(new RuntimeInitializedClassBuildItem("org.jboss.resteasy.links.impl.EL"));
            resteasyJaxrsProviderBuildItemBuildProducer
                    .produce(new ResteasyJaxrsProviderBuildItem(SortQueryParamFilter.class.getName()));
        } else {
            containerRequestFilterBuildItemBuildProducer
                    .produce(new ContainerRequestFilterBuildItem.Builder(SortQueryParamFilter.class.getName())
                            .setNameBindingNames(Collections.singleton(SortQueryParamValidator.class.getName())).build());
        }
    }

    @BuildStep
    void implementResources(CombinedIndexBuildItem index,
            List<RestDataResourceBuildItem> resourceBuildItems,

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the reactive stack dependency: io.quarkus:quarkus-rest (recommended for new apps)
  2. Or add the classic stack: io.quarkus:quarkus-resteasy
  3. Verify with mvn dependency:tree that a REST extension is present in the runtime module
  4. If the service truly needs no REST endpoints, remove the rest-data-panache dependency

Example fix

// before (pom.xml)
<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-rest-data-panache</artifactId>
</dependency>

// after
<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-rest-data-panache</artifactId>
</dependency>
Defensive patterns

Strategy: validation

Validate before calling

// pom.xml check before building
// ensure exactly one REST stack is present:
//   io.quarkus:quarkus-rest        (reactive, recommended)
//   io.quarkus:quarkus-resteasy    (classic)
// mvn dependency:tree -Dincludes=io.quarkus:quarkus-rest,io.quarkus:quarkus-resteasy

Try / catch

// build-time failure — no runtime catch is possible;
// fix the dependencies and rebuild

Prevention

When it happens

Trigger: Adding io.quarkus:quarkus-rest-data-panache (or hibernate-rest-data-panache / reactive variants) to a project without quarkus-rest or quarkus-resteasy, then building the application.

Common situations: Newly generated apps missing the REST layer dependency; removing quarkus-resteasy during a migration to quarkus-rest while forgetting to add it; adding REST Data Panache to a non-HTTP (messaging-only) service.

Related errors


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