{"record":{"id":"6444875f7f6f5e8a","repo":"hibernate/hibernate-orm","slug":"could-not-find-a-formatmapper-for-the-xml-format","errorCode":null,"errorMessage":"Could not find a FormatMapper for the XML format, which is required for mapping XML types. XML FormatMapper configuration is automatic, but requires that you have either Jackson XML or a JAXB implementation like Glassfish JAXB on the class path.","messagePattern":"Could not find a FormatMapper for the XML format, which is required for mapping XML types\\. XML FormatMapper configuration is automatic, but requires that you have either Jackson XML or a JAXB implementation like Glassfish JAXB on the class path\\.","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java","lineNumber":1579,"sourceCode":"\t\treturn preferLocaleLanguageTagEnabled;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic FormatMapper getJsonFormatMapper() {\n\t\tif ( jsonFormatMapper == null ) {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Could not find a FormatMapper for the JSON format, which is required for mapping JSON types. JSON FormatMapper configuration is automatic, but requires that you have either Jackson or a JSONB implementation like Yasson on the class path.\"\n\t\t\t);\n\t\t}\n\t\treturn jsonFormatMapper;\n\t}\n\n\t@Override\n\t@Nonnull\n\tpublic FormatMapper getXmlFormatMapper() {\n\t\tif ( xmlFormatMapper == null ) {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Could not find a FormatMapper for the XML format, which is required for mapping XML types. XML FormatMapper configuration is automatic, but requires that you have either Jackson XML or a JAXB implementation like Glassfish JAXB on the class path.\"\n\t\t\t);\n\t\t}\n\t\treturn xmlFormatMapper;\n\t}\n\n\t@Override\n\tpublic boolean isXmlFormatMapperLegacyFormatEnabled() {\n\t\treturn xmlFormatMapperLegacyFormatEnabled;\n\t}\n\n\t@Override\n\tpublic boolean isPassProcedureParameterNames() {\n\t\treturn passProcedureParameterNames;\n\t}\n\n\t@Override\n\tpublic boolean isPreferJdbcDatetimeTypesInNativeQueriesEnabled() {","sourceCodeStart":1561,"sourceCodeEnd":1597,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L1561-L1597","documentation":"Error \"Could not find a FormatMapper for the XML format, which is required for mapping XML types. XML FormatMapper configuration is automatic, but requires that you have either Jackson XML or a JAXB implementation like Glassfish JAXB on the class path.\" thrown in hibernate/hibernate-orm.","triggerScenarios":"No FormatMapper for the requested format is found while mapping a JSON/XML column.","commonSituations":"Mapping a JSON or XML attribute without Jackson (or a JSON-B/JAXB implementation such as Yasson/Glassfish JAXB) on the classpath.","solutions":["Add com.fasterxml.jackson.dataformat:jackson-dataformat-xml or a JAXB implementation (e.g. org.glassfish.jaxb:jaxb-runtime) to the classpath.","If XML mapping is not needed, remove the @JdbcTypeCode(SqlTypes.XML)/XML-typed attribute from the entity.","Alternatively register a custom FormatMapper via hibernate.type.xml_format_mapper."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}