{"record":{"id":"753c155251fef7eb","repo":"quarkusio/quarkus","slug":"unsupported-serialization-format","errorCode":null,"errorMessage":"Unsupported serialization format: ","messagePattern":"Unsupported serialization format: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/ApplicationModelSerializer.java","lineNumber":45,"sourceCode":" */\npublic class ApplicationModelSerializer {\n\n    private static final MappableCollectionFactory JSON_CONTAINER_FACTORY = new JsonCollectionFactory();\n\n    private static final String QUARKUS_APPLICATION_MODEL_SERIALIZATION_FORMAT_PROP = \"quarkus.bootstrap.application-model.serialization.format\";\n    // whether to use Java Object Serialization as a format\n    private static final boolean JOS;\n    static {\n        final String serializationFormat = System.getProperty(QUARKUS_APPLICATION_MODEL_SERIALIZATION_FORMAT_PROP);\n        if (serializationFormat == null) {\n            JOS = false;\n        } else {\n            if (serializationFormat.equalsIgnoreCase(\"jos\")) {\n                JOS = true;\n            } else {\n                JOS = false;\n                if (!serializationFormat.equalsIgnoreCase(\"json\")) {\n                    throw new IllegalStateException(\"Unsupported serialization format: \" + serializationFormat);\n                }\n            }\n        }\n    }\n\n    /**\n     * Creates a temporary file to serialize an application model.\n     *\n     * @param test whether it's for a test model\n     * @return temporary file\n     * @throws IOException in case of a failure\n     */\n    private static Path getTempFile(boolean test) throws IOException {\n        return Files.createTempFile(\n                \"quarkus-\" + (test ? \"test-\" : \"\") + \"app-model\",\n                \".dat\");\n    }\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/app/ApplicationModelSerializer.java#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nnew ApplicationModelSerializer(\"xml\");\n// after\nnew ApplicationModelSerializer(\"json\");","handlingStrategy":"validation","validationCode":"String fmt = System.getProperty(\"appmodel.format\", \"json\");\nif (!fmt.equalsIgnoreCase(\"json\") && !fmt.equalsIgnoreCase(\"jos\")) {\n    throw new IllegalArgumentException(\"Format must be json or jos: \" + fmt);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new ApplicationModelSerializer(fmt);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Unsupported serialization format\")) { /* default to json */ }\n}","preventionTips":["Only use the documented values: \"json\" and \"jos\"","Trim config strings read from env/properties","Prefer \"json\" for cross-version tolerant caches"],"tags":["serialization","configuration","illegal-argument"],"backgroundTag":"unsupported-serialization-format","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}