quarkusio/quarkus · error · IllegalStateException
'quarkus-narayana-lra' can only work if 'quarkus-rest-jackso
Error message
'quarkus-narayana-lra' can only work if 'quarkus-rest-jackson' or 'quarkus-resteasy-jackson' is present
What it means
The quarkus-narayana-lra extension needs a REST implementation with Jackson to host LRA participant endpoints and serialize LRA payloads. This build-time IllegalStateException in NarayanaLRAProcessor.registerFeature fails the build when neither quarkus-rest-jackson (reactive) nor quarkus-resteasy-jackson (classic) capability is present. It is a dependency/configuration error caught during application build, not at runtime.
Source
Thrown at extensions/narayana-lra/deployment/src/main/java/io/quarkus/narayana/lra/deployment/NarayanaLRAProcessor.java:44
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.narayana.lra.runtime.NarayanaLRAProducers;
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()View on GitHub (pinned to e1c734241f)
Solutions
- Add io.quarkus:quarkus-rest-jackson (reactive REST) or io.quarkus:quarkus-resteasy-jackson (classic REST) to the pom.xml
- If you intentionally use JSON-B, still add the Jackson extension since LRA requires it, or switch the app's JSON layer to Jackson
- If LRA is no longer needed, remove quarkus-narayana-lra from the dependencies
Example fix
<!-- before: no REST Jackson dependency --> <dependency><groupId>io.quarkus</groupId><artifactId>quarkus-narayana-lra</artifactId></dependency> // after <dependency><groupId>io.quarkus</groupId><artifactId>quarkus-rest-jackson</artifactId></dependency>
Defensive patterns
Strategy: validation
Validate before calling
// build-time check: ensure a REST JSON-Jackson extension is in pom.xml grep -E "quarkus-(rest|resteasy)-jackson" pom.xml || echo "MISSING: add quarkus-rest-jackson"
Prevention
- When adding quarkus-narayana-lra, also add quarkus-rest-jackson or quarkus-resteasy-jackson
- Don't swap the app's JSON mapper to JSON-B while LRA is present
- Run ./mvnw verify to catch capability conflicts at build time
- Review extension 'capability requirements' in its README before adding
When it happens
Trigger: Building an application that includes quarkus-narayana-lra while neither REST JSON-Jackson capability is on the classpath — e.g. REST endpoints use a different serializer (no Jackson), or the app has no REST layer at all, or uses quarkus-resteasy with JSON-B instead of Jackson.
Common situations: Using quarkus-resteasy-jsonb or quarkus-rest-jackson replaced by another JSON mapper; forgetting to add a REST extension entirely; removing the REST dependency during refactoring while LRA stays in pom.xml.
Related errors
- 'quarkus-narayana-lra' can only work if 'quarkus-rest-client
- Type {fieldType} should be handled by the switch
- Type {type} should be handled by the switch
- Failed to open path tree with root %s
- Dev services for ${request.getName()} requires a startable s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/6f1938c227592248.
Report an issue: GitHub.