quarkusio/quarkus · error · IllegalStateException

Unable to parse: ${resolvedModelPath}

Error message

Unable to parse: ${resolvedModelPath}

What it means

The Quarkus config documentation annotation processor (ConfigDocAnnotationProcessor) failed to read or parse a serialized config documentation model JSON file while merging per-extension models into one. mergeModel walks resolvedModelPath files, deserializes each into a ConfigRoot, and merges them; any IOException during parsing is wrapped in this IllegalStateException. It almost always means an existing quarkus-config-docs model JSON on the processing path is corrupt, stale, or unreadable.

Source

Thrown at core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/merger/ModelMerger.java:119

                        continue;
                    }

                    Map<ConfigRootKey, ConfigRoot> extensionConfigRoots = configRoots.computeIfAbsent(
                            normalizeExtension(configRoot.getExtension(), mergeCommonOrInternalExtensions),
                            e -> new TreeMap<>());

                    ConfigRootKey configRootKey = getConfigRootKey(javadocRepository, configRoot);
                    ConfigRoot existingConfigRoot = extensionConfigRoots.get(configRootKey);

                    if (existingConfigRoot == null) {
                        extensionConfigRoots.put(configRootKey, configRoot);
                    } else {
                        existingConfigRoot.merge(configRoot);
                    }
                }
            } catch (IOException e) {
                throw new IllegalStateException("Unable to parse: " + resolvedModelPath, e);
            }
        }

        // note that the configRoots are now sorted by extension name
        configRoots = retainBestExtensionKey(configRoots);

        for (Entry<Extension, Map<ConfigRootKey, ConfigRoot>> extensionConfigRootsEntry : configRoots.entrySet()) {
            List<ConfigSection> extensionGeneratedConfigSections = generatedConfigSections
                    .computeIfAbsent(extensionConfigRootsEntry.getKey(), e -> new ArrayList<>());

            for (ConfigRoot configRoot : extensionConfigRootsEntry.getValue().values()) {
                collectGeneratedConfigSections(extensionGeneratedConfigSections, configRoot);
            }
        }

        return new MergedModel(configRoots, configRootsInSpecificFile, generatedConfigSections);
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run a clean build (mvn clean install) to remove stale/corrupt model JSON files.
  2. Check the file at the path in the message: verify it is valid JSON, readable, and not truncated (0 bytes or cut off).
  3. Delete the offending model JSON from the dependency jar or target directory and rebuild.
  4. Ensure all modules are built with the same Quarkus version so the model format matches.
  5. If caused by the processor itself failing to write then read its file, report with the full stack trace including the wrapped IOException.

Example fix

// before: stale corrupt model in target reused across builds
$ mvn install
IllegalStateException: Unable to parse: target/classes/quarkus-config-docs/model.json

// after: force regeneration of the model file
$ mvn clean install
Defensive patterns

Strategy: validation

Validate before calling

// before building, verify model files are valid JSON
Path model = Path.of("target/classes/quarkus-config-docs/model.json");
if (Files.exists(model)) {
    try (var in = Files.newInputStream(model)) {
        new ObjectMapper().readTree(in); // throws if corrupt
    }
}

Try / catch

try {
    mergeModel(...);
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("Unable to parse:")) {
        Files.deleteIfExists(modelPath); // regenerate stale model
        mergeModel(...);
    } else throw e;
}

Prevention

When it happens

Trigger: Running the annotation processor when the file at resolvedModelPath (an accumulated quarkus-config-docs model JSON from a previous round/dependency jar) exists but cannot be read or deserialized: truncated/corrupt JSON, unreadable file permissions, invalid encoding, or a model produced by an incompatible processor version.

Common situations: Incremental builds after a Quarkus upgrade left an old-format model JSON in target/ or a dependency jar; interrupted builds leaving partially written JSON; read-only or permission-denied output directories in CI; classpath pollution where a stale quarkus-config-docs model from another module is picked up.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


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