quarkusio/quarkus · error · MessageBundleException

Missing key/value separator - file: {localizedFile} - line

Error message

Missing key/value separator
	- file: {localizedFile}
	- line {index}

What it means

When reading localized message bundle .properties files (or merge candidates) at build time, each non-comment logical line must contain a key/value separator '='. A line without '=' cannot be parsed into a message template, so MessageBundleProcessor fails the build naming the offending file and line number.

Source

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

    private Map<String, String> parseKeyToTemplateFromLocalizedFiles(ClassInfo bundleInterface,
            List<MessageFile> localizedFile, IndexView index) throws IOException {
        Map<String, String> keyToTemplate = new HashMap<>();
        for (MessageFile messageFile : localizedFile) {
            for (ListIterator<String> it = Files.readAllLines(messageFile.path()).listIterator(); it.hasNext();) {
                String line = it.next();
                if (line.isBlank()) {
                    // Blank lines are skipped
                    continue;
                }
                line = line.strip();
                if (line.startsWith("#")) {
                    // Comments are skipped
                    continue;
                }
                int eqIdx = line.indexOf('=');
                if (eqIdx == -1) {
                    throw new MessageBundleException(
                            "Missing key/value separator\n\t- file: " + localizedFile + "\n\t- line " + it.previousIndex());
                }
                String key = line.substring(0, eqIdx).strip();
                if (keyToTemplate.containsKey(key)) {
                    // Message template with higher priority takes precedence
                    continue;
                }
                if (!hasMessageBundleMethod(bundleInterface, key) && !isEnumConstantMessageKey(key, index, bundleInterface)) {
                    throw new MessageBundleException(
                            "Message bundle method " + key + "() not found on: " + bundleInterface + "\n\t- file: "
                                    + localizedFile + "\n\t- line " + it.previousIndex());
                }
                String value = adaptLine(line.substring(eqIdx + 1, line.length()));
                if (value.endsWith("\\")) {
                    // The logical line is spread out across several normal lines
                    StringBuilder builder = new StringBuilder(value.substring(0, value.length() - 1));
                    constructLine(builder, it);
                    keyToTemplate.put(key, builder.toString());

View on GitHub (pinned to e1c734241f)

Solutions

  1. Open the file named in the message at the reported line and add the missing '=' between key and value: `hello=Hello {name}`.
  2. Check the preceding line for a trailing backslash ('\') continuation that incorrectly swallows the next line's '='.
  3. If the line is not a message, delete it or comment it out with '#'.

Example fix

// before (messages_de.properties)
hello_message

// after
hello=Hallo {name}
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate bundle properties files for key=value separators
java.nio.file.Files.lines(Path.of("messages_de.properties"))
    .filter(l -> !l.isBlank() && !l.startsWith("#"))
    .filter(l -> l.indexOf('=') == -1)
    .findFirst()
    .ifPresent(l -> { throw new IllegalStateException("Missing '=' in line: " + l); });

Prevention

When it happens

Trigger: A line in a bundle properties file such as `hello_message` or a wrapped continuation line that lost its '='; values containing newlines mis-split by the logical-line reader.

Common situations: Hand-editing .properties files and accidentally deleting '='; diff-merge conflicts dropping characters; non-ASCII editors mangling lines; accidental paste of prose into the file.

Related errors


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