quarkusio/quarkus · error · IllegalStateException

'quarkus-narayana-lra' can only work if 'quarkus-rest-client

Error message

'quarkus-narayana-lra' can only work if 'quarkus-rest-client' or 'quarkus-resteasy-client' is present

What it means

The quarkus-narayana-lra extension uses REST clients to communicate with the LRA coordinator, so the build fails with this IllegalStateException if no REST client capability (quarkus-rest-client / quarkus-rest, or the classic quarkus-resteasy-client) is present. Like the sibling check, this is enforced at build time in NarayanaLRAProcessor.registerFeature via Capabilities.

Source

Thrown at extensions/narayana-lra/deployment/src/main/java/io/quarkus/narayana/lra/deployment/NarayanaLRAProcessor.java:49

import io.quarkus.narayana.lra.runtime.NarayanaLRARecorder;
import io.quarkus.smallrye.openapi.deployment.spi.AddToOpenAPIDefinitionBuildItem;

class NarayanaLRAProcessor {

    private static final DotName PATH = DotName.createSimple("jakarta.ws.rs.Path");

    @BuildStep
    void registerFeature(BuildProducer<FeatureBuildItem> feature, Capabilities capabilities) {
        boolean isResteasyClassicAvailable = capabilities.isPresent(Capability.RESTEASY_JSON_JACKSON);
        boolean isResteasyReactiveAvailable = capabilities.isPresent(Capability.RESTEASY_REACTIVE_JSON_JACKSON);

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

        if (!capabilities.isCapabilityWithPrefixPresent(Capability.REST_CLIENT)) {
            throw new IllegalStateException(
                    "'quarkus-narayana-lra' can only work if 'quarkus-rest-client' or 'quarkus-resteasy-client' is present");
        }

        feature.produce(new FeatureBuildItem(Feature.NARAYANA_LRA));
    }

    @BuildStep
    @Record(RUNTIME_INIT)
    public void build(NarayanaLRARecorder recorder) {
        recorder.setConfig();
    }

    @BuildStep()
    @Record(STATIC_INIT)
    void createLRAParticipantRegistry(NarayanaLRARecorder recorder,
            BeanArchiveIndexBuildItem beanArchiveIndex) {

        final List<String> classNames = new ArrayList<>();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add io.quarkus:quarkus-rest-client (or quarkus-rest-client-jackson) for reactive, or io.quarkus:quarkus-resteasy-client for classic REST
  2. Verify with ./mvnw dependency:tree that a REST client artifact is present alongside quarkus-narayana-lra
  3. Remove quarkus-narayana-lra if LRA participation is no longer needed

Example fix

<!-- before -->
<dependency><groupId>io.quarkus</groupId><artifactId>quarkus-narayana-lra</artifactId></dependency>
// after
<dependency><groupId>io.quarkus</groupId><artifactId>quarkus-narayana-lra</artifactId></dependency>
<dependency><groupId>io.quarkus</groupId><artifactId>quarkus-rest-client-jackson</artifactId></dependency>
Defensive patterns

Strategy: validation

Validate before calling

// build-time check: ensure a REST client extension is in pom.xml
grep -E "quarkus-(rest-client|resteasy-client|rest)" pom.xml || echo "MISSING: add quarkus-rest-client"

Prevention

When it happens

Trigger: Building an app with quarkus-narayana-lra on the classpath while capabilities.isCapabilityWithPrefixPresent(REST_CLIENT) is false — no quarkus-rest-client, quarkus-rest-client-jackson, quarkus-rest, or quarkus-resteasy-client dependency included.

Common situations: Adding only the LRA extension without any REST client; removing the REST client dependency after refactoring away REST calls; assuming LRA bundles its own HTTP client dependency (it does not in Quarkus).

Related errors


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