quarkusio/quarkus · error · MessageBundleException

Unable to determine the name of the parameter at position {p

Error message

Unable to determine the name of the parameter at position {position} in method {class}#{method}() - compile the class with debug info enabled (-g) or parameter names recorded (-parameters), or use @MessageParam to specify the value

What it means

Qute needs parameter names of message bundle methods to bind template parameters. If the compiled class lacks parameter name info (no -parameters / debug info) and no @MessageParam annotation names the parameter, MessageBundleException is thrown.

Source

Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java:1318

            }
        }
        return messageValue.asString();
    }

    static String getParameterName(MethodInfo method, int position) {
        String name = method.parameterName(position);
        AnnotationInstance paramAnnotation = Annotations
                .find(Annotations.getParameterAnnotations(method.annotations()).stream()
                        .filter(a -> a.target().asMethodParameter().position() == position).collect(Collectors.toList()),
                        Names.MESSAGE_PARAM);
        if (paramAnnotation != null) {
            AnnotationValue paramAnnotationValue = paramAnnotation.value();
            if (paramAnnotationValue != null && !paramAnnotationValue.asString().equals(Message.ELEMENT_NAME)) {
                name = paramAnnotationValue.asString();
            }
        }
        if (name == null) {
            throw new MessageBundleException("Unable to determine the name of the parameter at position " + position
                    + " in method "
                    + method.declaringClass().name() + "#" + method.name()
                    + "() - compile the class with debug info enabled (-g) or parameter names recorded (-parameters), or use @MessageParam to specify the value");
        }
        return name;
    }

    private void implementResolve(String defaultBundleImpl, ClassCreator bundleCreator, Map<String, MessageMethod> keyMap,
            String resolveMethodPrefix, String generatedClassName) {

        // We do group messages to workaround limits of a JVM method body
        int groupLimit = 300;
        List<List<Entry<String, MessageMethod>>> resolveGroups = new ArrayList<>();
        List<Entry<String, MessageMethod>> resolveGroup = new ArrayList<>(groupLimit);
        for (Entry<String, MessageMethod> entry : keyMap.entrySet()) {
            if (resolveGroup.size() >= groupLimit) {
                resolveGroups.add(resolveGroup);
                resolveGroup = new ArrayList<>(groupLimit);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Compile the bundle interface with -parameters (and -g) javac flags
  2. Annotate each method parameter with @MessageParam("name") to specify the name explicitly
  3. Configure maven-compiler-plugin <parameters>true</parameters> in the module containing the bundle

Example fix

// before
@Message("Hello {name}")
String hello(String name); // compiled without -parameters
// after
@Message("Hello {name}")
String hello(@MessageParam("name") String name);
Defensive patterns

Strategy: validation

Validate before calling

// build check: enforce -parameters
// pom.xml
// <compilerArgs><arg>-parameters</arg></compilerArgs>

Prevention

When it happens

Trigger: A @MessageBundle interface method compiled without the -parameters javac flag (and without debug info) whose parameters lack @MessageParam annotations.

Common situations: Building with default Maven compiler settings without -parameters; using prebuilt dependency JARs of bundle interfaces; adding a new parameter to a bundle method in a library compiled without parameter names.

Related errors


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