quarkusio/quarkus · error · IllegalStateException

Cannot generate HAL endpoints without either 'quarkus-rest-j

Error message

Cannot generate HAL endpoints without either 'quarkus-rest-jsonb' or 'quarkus-rest-jackson'

What it means

Same check as the classic variant but for RESTEasy Reactive: when HAL endpoints are generated for a resource and the application does not include a reactive JSON serializer (quarkus-rest-jsonb or quarkus-rest-jackson), the deployment fails. HAL response generation depends on the reactive JSON provider being available.

Source

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

        }

        Set<String> excludedClasses = getExcludedClasses(buildTimeConditions);
        ClassOutput classOutput = isResteasyClassic ? new GeneratedBeanGizmoAdaptor(resteasyClassicImplementationsProducer)
                : new GeneratedJaxRsResourceGizmoAdaptor(resteasyReactiveImplementationsProducer);
        JaxRsResourceImplementor jaxRsResourceImplementor = new JaxRsResourceImplementor(capabilities);
        ResourcePropertiesProvider resourcePropertiesProvider = new ResourcePropertiesProvider(index.getIndex());

        for (RestDataResourceBuildItem resourceBuildItem : resourceBuildItems) {
            if (!excludedClasses.contains(resourceBuildItem.getResourceMetadata().getResourceName())) {
                ResourceMetadata resourceMetadata = resourceBuildItem.getResourceMetadata();
                ResourceProperties resourceProperties = getResourceProperties(resourcePropertiesProvider,
                        resourceMetadata, resourcePropertiesBuildItems);
                if (resourceProperties.isHal()) {
                    if (isResteasyClassic && !hasAnyJsonCapabilityForResteasyClassic(capabilities)) {
                        throw new IllegalStateException("Cannot generate HAL endpoints without "
                                + "either 'quarkus-resteasy-jsonb' or 'quarkus-resteasy-jackson'");
                    } else if (!isResteasyClassic && !hasAnyJsonCapabilityForResteasyReactive(capabilities)) {
                        throw new IllegalStateException("Cannot generate HAL endpoints without "
                                + "either 'quarkus-rest-jsonb' or 'quarkus-rest-jackson'");
                    }

                }
                if (resourceProperties.isExposed()) {
                    jaxRsResourceImplementor.implement(classOutput, resourceMetadata, resourceProperties, capabilities);
                }
            }
        }
    }

    private ResourceProperties getResourceProperties(ResourcePropertiesProvider resourcePropertiesProvider,
            ResourceMetadata resourceMetadata, List<ResourcePropertiesBuildItem> resourcePropertiesBuildItems) {
        for (ResourcePropertiesBuildItem resourcePropertiesBuildItem : resourcePropertiesBuildItems) {
            if (resourcePropertiesBuildItem.getResourceType().equals(resourceMetadata.getResourceClass())
                    || resourcePropertiesBuildItem.getResourceType().equals(resourceMetadata.getResourceName())) {
                return resourcePropertiesBuildItem.getResourcePropertiesInfo();
            }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add io.quarkus:quarkus-rest-jackson (or quarkus-rest-jsonb) to the dependencies.
  2. If the app is actually RESTEasy Classic, add quarkus-resteasy-jackson/quarkus-resteasy-jsonb instead.
  3. Disable HAL for the resource if HAL links are not needed.

Example fix

// before (pom.xml): reactive REST, no JSON provider
<dependency>io.quarkus:quarkus-rest</dependency>
// after
<dependency>io.quarkus:quarkus-rest</dependency>
<dependency>io.quarkus:quarkus-rest-jackson</dependency>
Defensive patterns

Strategy: validation

Validate before calling

// verify reactive JSON capability before enabling HAL
if (usesReactiveRest() && !hasDependency("io.quarkus:quarkus-rest-jackson")
        && !hasDependency("io.quarkus:quarkus-rest-jsonb")) {
    throw new IllegalStateException("Add quarkus-rest-jackson to generate HAL endpoints");
}

Prevention

When it happens

Trigger: Build time: HAL is enabled for a REST Data Panache resource while the app uses RESTEasy Reactive (isResteasyClassic false) and neither quarkus-rest-jsonb nor quarkus-rest-jackson capability is present.

Common situations: App uses quarkus-rest (reactive) but the JSON extension was never added; dependency tree was pruned of jackson/jsonb; user followed Classic docs in a Reactive app and added the wrong (resteasy-*) JSON extension.

Related errors


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