quarkusio/quarkus · error · MessageBundleException
Message bundle method {key}() not found on: {bundleInterface
Error message
Message bundle method {key}() not found on: {bundleInterface}
- file: {localizedFile}
- line {index} What it means
Every key in a localized bundle .properties file must correspond to a method on the message bundle interface (or be an enum-constant message key for enums in the bundle). When a key has no matching bundle method, the build fails, listing the key, the bundle interface, the file, and the line.
Source
Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java:897
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());
} else {
keyToTemplate.put(key, value);
}
}
}
return keyToTemplate;
}
/**View on GitHub (pinned to e1c734241f)
Solutions
- Add the missing method to the bundle interface (with @Message/template) so the key has a source method.
- Or remove/rename the offending line in the properties file to match an existing method key.
- Diff all localized files against the default bundle's keys to catch every stale key at once.
Example fix
// before (messages_de.properties)
goodbye=Auf Wiedersehen
// interface has only hello()
// after
// interface:
String goodbye(String name);
// properties:
goodbye=Auf Wiedersehen {name} Defensive patterns
Strategy: validation
Validate before calling
// Ensure every properties key has a matching bundle method
java.util.Set<String> methods = java.util.Set.of("hello", "goodbye");
java.nio.file.Files.lines(Path.of("messages_de.properties"))
.filter(l -> l.contains("="))
.map(l -> l.substring(0, l.indexOf('=')).strip())
.filter(k -> !methods.contains(k))
.forEach(k -> { throw new IllegalStateException("No bundle method for key: " + k); }); Prevention
- Update all locale files whenever bundle methods change
- Add a CI check diffing keys across locales
- Avoid hand-merging translations from other projects
When it happens
Trigger: A .properties file contains `goodbye=...` but the bundle interface AppMessages has no `goodbye()` method; key renamed in the interface but the properties file not updated (or vice versa); typo in the key.
Common situations: Adding translations by hand before/after changing the interface; merging locale files from another project with different keys; deleting a bundle method but leaving stale entries in de/fr/es properties files.
Related errors
- Missing key/value separator - file: {localizedFile} - line
- A localized message bundle interface must extend a message b
- @Localized must be declared on an interface: {localized}
- Default bundle method not found on %s: %s
- No suitable template variant found
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/d4230eb637ed8a16.
Report an issue: GitHub.