quarkusio/quarkus · error · IllegalStateException
Unsupported serialization format:
Error message
Unsupported serialization format:
What it means
ApplicationModelSerializer's constructor accepts only two serialization formats: "jos" (Java object serialization) and "json" (case-insensitive). Any other value results in this IllegalStateException at construction time, failing fast rather than failing later during serialize/deserialize.
Source
Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/ApplicationModelSerializer.java:45
*/
public class ApplicationModelSerializer {
private static final MappableCollectionFactory JSON_CONTAINER_FACTORY = new JsonCollectionFactory();
private static final String QUARKUS_APPLICATION_MODEL_SERIALIZATION_FORMAT_PROP = "quarkus.bootstrap.application-model.serialization.format";
// whether to use Java Object Serialization as a format
private static final boolean JOS;
static {
final String serializationFormat = System.getProperty(QUARKUS_APPLICATION_MODEL_SERIALIZATION_FORMAT_PROP);
if (serializationFormat == null) {
JOS = false;
} else {
if (serializationFormat.equalsIgnoreCase("jos")) {
JOS = true;
} else {
JOS = false;
if (!serializationFormat.equalsIgnoreCase("json")) {
throw new IllegalStateException("Unsupported serialization format: " + serializationFormat);
}
}
}
}
/**
* Creates a temporary file to serialize an application model.
*
* @param test whether it's for a test model
* @return temporary file
* @throws IOException in case of a failure
*/
private static Path getTempFile(boolean test) throws IOException {
return Files.createTempFile(
"quarkus-" + (test ? "test-" : "") + "app-model",
".dat");
}
View on GitHub (pinned to e1c734241f)
Solutions
- Pass "json" (default) or "jos" as the serialization format
- Check the system property/env value feeding the format string for typos or stray whitespace
- Omit the format argument to use the default format
Example fix
// before
new ApplicationModelSerializer("xml");
// after
new ApplicationModelSerializer("json"); Defensive patterns
Strategy: validation
Validate before calling
String fmt = System.getProperty("appmodel.format", "json");
if (!fmt.equalsIgnoreCase("json") && !fmt.equalsIgnoreCase("jos")) {
throw new IllegalArgumentException("Format must be json or jos: " + fmt);
} Try / catch
try {
new ApplicationModelSerializer(fmt);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Unsupported serialization format")) { /* default to json */ }
} Prevention
- Only use the documented values: "json" and "jos"
- Trim config strings read from env/properties
- Prefer "json" for cross-version tolerant caches
When it happens
Trigger: Constructing `new ApplicationModelSerializer(format)` with a string other than "jos" or "json" — typically a typo like "java", "JSONS", or an environment/config-driven value with unexpected content.
Common situations: Setting a system property or config value controlling the app-model serialization format to an unsupported string, IDE/tooling passing a custom format name, or copy-pasted config from another tool.
Related errors
- Unknown JAR package type '${value}'
- Unable to resolve locale: ${value}
- Unsupported compressor '
- proxyHost must not be null
- Invalid port number
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/753c155251fef7eb.
Report an issue: GitHub.