quarkusio/quarkus · error · IllegalStateException
methodName must be provided
Error message
methodName must be provided
What it means
Thrown by BuildTimeActionBuildItem.ActionBuilder.build when a build-time JSON-RPC action is registered without a method name. The method name is the key the Dev UI / MCP endpoint uses to route invocations; an action with a blank methodName cannot be addressed, so the build-time guard rejects the contribution during extension build.
Source
Thrown at extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java:190
}
public <T> ActionBuilder assistantFunction(BiFunction<Object, Map<String, String>, ?> assistantFunction) {
if (this.function != null || this.runtimeValue != null)
throw new IllegalStateException("Only one of runtimeValue, function or assistantFunction is allowed");
this.assistantFunction = assistantFunction;
return this;
}
public ActionBuilder runtime(RuntimeValue<?> runtimeValue) {
if (this.function != null || this.assistantFunction != null)
throw new IllegalStateException("Only one of runtimeValue, function or assistantFunction is allowed");
this.runtimeValue = runtimeValue;
return this;
}
public BuildTimeActionBuildItem build() {
if (methodName == null || methodName.isBlank())
throw new IllegalStateException("methodName must be provided");
if (parameters.isEmpty())
parameters = null;
if (function != null) {
return addAction(
new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),
mcpEnabledByDefault,
function));
} else if (runtimeValue != null) {
return addAction(
new RecordedJsonRpcMethod(methodName, description, autoUsage(usage, description),
mcpEnabledByDefault,
runtimeValue));
} else if (assistantFunction != null) {
return addAction(
new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),
mcpEnabledByDefault,
assistantFunction));
} else {View on GitHub (pinned to e1c734241f)
Solutions
- Call .methodName("yourAction") before build()
- If the name is dynamic, validate/fail-fast that it is non-blank upstream
Example fix
// before
BuildTimeActionBuildItem item = new BuildTimeActionBuildItem("my-extension")
.build();
// after
BuildTimeActionBuildItem item = new BuildTimeActionBuildItem("my-extension")
.methodName("getInfo")
.runtime(runtimeValue)
.build(); Defensive patterns
Strategy: validation
Validate before calling
if (methodName == null || methodName.isBlank()) {
throw new IllegalArgumentException("Action methodName must be non-blank");
} Try / catch
try {
item = actionBuilder.build();
} catch (IllegalStateException e) {
if (e.getMessage().contains("methodName must be provided")) { /* supply methodName */ }
else throw e;
} Prevention
- Always call methodName() first in the builder chain
- Fail fast on dynamic names before passing them in
- Cover Dev UI action registration with a deployment-time test
When it happens
Trigger: Calling ActionBuilder.build() without ActionBuilder.methodName(String).
Common situations: Building the item programmatically where the method name comes from config or a constant that is unexpectedly empty/null.
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
- Only one of runtimeValue, function or assistantFunction is a
- Either function, assistantFunction or runtimeValue must be p
- Either function or runtimeValue must be provided
- Invalid template
- FileName is mandatory, for example 'index.html'
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f4fe9937df8b589f.
Report an issue: GitHub.