quarkusio/quarkus · error · MessageBundleException
Duplicate localized files with priority {priority} found: -
Error message
Duplicate localized files with priority {priority} found:
- {locale}: {files} What it means
When resolving localized message bundle files (e.g. messages_en.properties), Qute assigns priorities to files found in different locations (app vs dependencies). If two or more files for the same locale share the same priority, resolution is ambiguous and MessageBundleException is thrown.
Source
Thrown at extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java:1645
}
}
private void checkForDuplicates(Map<String, List<MessageFile>> groupByName) {
// Check for duplicates
// If there are multiple message files of the same priority then fail the build
for (var entry : groupByName.entrySet()) {
if (entry.getValue().size() > 1) {
Map<Integer, List<MessageFile>> groupByPriority = entry.getValue().stream()
.collect(Collectors.groupingBy(MessageFile::priority));
for (var groupEntry : groupByPriority.entrySet()) {
if (groupEntry.getValue().size() > 1) {
StringBuilder builder = new StringBuilder("Duplicate localized files with priority ")
.append(groupEntry.getValue().get(0).priority())
.append(" found:\n\t- ")
.append(entry.getKey())
.append(": ")
.append(groupEntry.getValue());
throw new MessageBundleException(builder.toString());
}
}
}
}
}
private List<MessageFile> findMessageFiles(ApplicationArchivesBuildItem applicationArchives,
BuildProducer<HotDeploymentWatchedFileBuildItem> watchedFiles) throws IOException {
List<MessageFile> messageFiles = new ArrayList<>();
addMessageFiles(applicationArchives.getRootArchive(), 10, messageFiles);
for (ApplicationArchive archive : applicationArchives.getArchives()) {
addMessageFiles(archive, 1, messageFiles);
}
if (messageFiles.isEmpty()) {
return List.of();View on GitHub (pinned to e1c734241f)
Solutions
- Rename or remove the duplicate file in one of the locations
- Move the application's bundle to src/main/resources/messages/ where app files take priority over dependencies
- Change the conflicting file's directory so the computed priorities differ
Defensive patterns
Strategy: validation
Validate before calling
// Detect duplicate message resources on classpath
Enumeration<URL> urls = clazz.getClassLoader().getResources("messages_en.properties");
List<URL> all = Collections.list(urls);
if (all.size() > 1) throw new IllegalStateException("Duplicate message files: " + all); Prevention
- Audit dependency JARs for bundled message files
- Keep app bundles under src/main/resources/messages/ to win priority
- Use unique bundle names per module
When it happens
Trigger: Two message files for the same locale with identical priority exist on the classpath, e.g. messages_en.properties in the application and in an included dependency/jar, both with the same effective priority.
Common situations: Vendor/dependency JARs shipping message bundles that collide with the app's own bundles; copying bundle files between modules; duplicated resource paths after a refactor.
Related errors
- Locale of [%s] conflicts with the locale [%s] of the default
- Cannot register [%s] - a localized message bundle interface
- Enum constant message not found in bundle [%s] for key: %s
- Message template for key [%s] is missing for default locale
- Message bundle name [%s] declared on %s must be a valid name
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/fbf6cb4d5ed37ab4.
Report an issue: GitHub.