quarkusio/quarkus · error · RuntimeException
CardAction requires either jsonRpcMethodName() or url()
Error message
CardAction requires either jsonRpcMethodName() or url()
What it means
CardActionBuilder.build() requires an actionType plus a non-empty actionReference. An action must point somewhere — either a JSON-RPC method name (jsonRpcMethodName(...)) or a URL (url(...)). Building without either leaves the Dev UI button with no target, so the library fails fast.
Source
Thrown at extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/page/CardActionBuilder.java:52
}
public CardActionBuilder url(String url) {
this.actionType = CardAction.ActionType.URL;
this.actionReference = url;
return this;
}
public CardActionBuilder showResultNotification(boolean show) {
this.showResultNotification = show;
return this;
}
public CardAction build() {
if (title == null || title.isEmpty()) {
throw new RuntimeException("CardAction title is required");
}
if (actionType == null || actionReference == null || actionReference.isEmpty()) {
throw new RuntimeException("CardAction requires either jsonRpcMethodName() or url()");
}
return new CardAction(title, icon, tooltip,
actionType, actionReference, showResultNotification);
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Call either jsonRpcMethodName("myRpcMethod") or url("https://...") on the builder before build()
- Ensure the JSON-RPC method exists in a @JsonRpc class registered for Dev UI and its name matches exactly
- If the target is conditional, guard build() and skip creating the CardAction entirely when neither target is available
- Log/assert the builder state in tests that construct Dev UI pages
Example fix
// before
CardAction action = new CardActionBuilder()
.title("Refresh")
.build(); // throws
// after
CardAction action = new CardActionBuilder()
.title("Refresh")
.jsonRpcMethodName("refreshData")
.build(); Defensive patterns
Strategy: validation
Validate before calling
boolean ready = (title != null && !title.isEmpty())
&& ((rpcMethod != null && !rpcMethod.isEmpty()) || (url != null && !url.isEmpty()));
if (!ready) throw new IllegalStateException("CardAction needs a title and a jsonRpcMethodName or url"); Type guard
boolean hasActionTarget(CardAction a) {
return a != null && a.getActionReference() != null && !a.getActionReference().isEmpty();
} Try / catch
try {
return builder.build();
} catch (RuntimeException e) {
if (e.getMessage().contains("jsonRpcMethodName() or url()")) {
log.warn("CardAction built without target, skipping");
return null;
}
throw e;
} Prevention
- Always pair title(...) with exactly one of jsonRpcMethodName(...) or url(...)
- Verify JSON-RPC method names exist in your Dev UI JSON-RPC classes
- Skip creating the action when no target is available rather than building an empty one
- Add tests that build all extension card actions at deployment time
When it happens
Trigger: Calling CardActionBuilder.build() after setting only title/icon/tooltip/showResultNotification, or calling jsonRpcMethodName(null) / url("") so actionType or actionReference stays null/empty.
Common situations: Extension authors defining card action buttons but forgetting to wire the click target; conditional code where both url() and jsonRpcMethodName() calls are skipped at runtime; refactors that renamed the RPC method string to an empty variable.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- CardAction title is required
- Invalid dynamic URL Method name, can not be empty
- You have to specify a key. This is the key the user will pre
- You have to specify a description. This is what the user wil
- You have to specify userMessage that will be send to AI, or
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3f57b7d4a2280561.
Report an issue: GitHub.