quarkusio/quarkus · error · AppModelResolverException
Failed to deserialize quarkus model
Error message
Failed to deserialize quarkus model
What it means
BootstrapUtils.deserializeQuarkusModel() reads a previously serialized ApplicationModel from disk (used as a dev-mode cache). If reading fails — corrupt/truncated cache file, an incompatibly serialized class after a Quarkus version change (ClassNotFoundException), or an I/O error — it wraps the failure in AppModelResolverException with this message. The cached model is deleted afterwards so a fresh resolution can occur on retry.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/util/BootstrapUtils.java:108
public static Path serializeQuarkusModel(ApplicationModel model) throws IOException {
final Path serializedModel = File.createTempFile("quarkus-model", ".dat").toPath();
serializeAppModel(model, serializedModel);
return serializedModel;
}
/**
* @deprecated for removal since 3.31.0 in favor of ApplicationModelSerializer methods
*/
@Deprecated(forRemoval = true)
public static ApplicationModel deserializeQuarkusModel(Path modelPath) throws AppModelResolverException {
if (Files.exists(modelPath)) {
try (InputStream existing = Files.newInputStream(modelPath);
ObjectInputStream object = new ObjectInputStream(existing)) {
ApplicationModel model = (ApplicationModel) object.readObject();
IoUtils.recursiveDelete(modelPath);
return model;
} catch (IOException | ClassNotFoundException e) {
throw new AppModelResolverException("Failed to deserialize quarkus model", e);
}
}
throw new AppModelResolverException("Unable to locate quarkus model");
}
/**
* Returns a location where a serialized {@link ApplicationModel} would be found for dev mode.
*
* @param projectBuildDir project build directory
* @return file of a serialized application model for dev mode
*/
public static Path resolveSerializedAppModelPath(Path projectBuildDir) {
return getBootstrapBuildDir(projectBuildDir).resolve("dev-app-model.dat");
}
/**
* Returns a location where a serialized {@link ApplicationModel} would be found for test mode.
*View on GitHub (pinned to e1c734241f)
Solutions
- Delete the cached model file / run a clean build so the model is re-resolved from scratch
- Re-resolve the application model instead of relying on the cache
- If it recurs after version upgrades, ensure all Quarkus artifacts are the same version
Example fix
// after a Quarkus upgrade mvn clean quarkus:dev // or delete the stale cache manually rm target/quarkus-bootstrap/app-model.dat
Defensive patterns
Strategy: fallback
Validate before calling
Path modelPath = BootstrapUtils.getSerializedModelLocation(buildDir);
boolean cacheUsable = Files.exists(modelPath)
&& Files.getLastModifiedTime(modelPath).toMillis() > lastCleanTime;
// if !cacheUsable, resolve the model fresh instead of deserializing Try / catch
try {
model = BootstrapUtils.deserializeQuarkusModel(modelPath);
} catch (AppModelResolverException e) {
log.debugf("Cache unusable (%s), re-resolving", e.getMessage());
model = resolver.resolveModel(workspace);
} Prevention
- Run mvn clean (or delete target/) after upgrading Quarkus
- Treat the serialized model purely as a cache and always keep a re-resolve fallback path
- Never copy target/ output across different Quarkus versions or JDKs
When it happens
Trigger: Loading a dev-mode cached application model from a modelPath whose file was written by a different Quarkus version (readObject throws ClassNotFoundException) or is corrupt (IOException).
Common situations: Upgrading Quarkus (or a dependency of ApplicationModel classes) without cleaning target/; killed build leaving a truncated cache; copying build output between machines/JDKs.
Related errors
- Unable to deserialize the dev mode context. Does the Quarkus
- Unable to locate quarkus model
- Hot deployment of the application is not supported when upda
- remote-dev can only be used with mutable applications i.e. u
- Failed to create compiler
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/06d3d43acb43950e.
Report an issue: GitHub.