{"record":{"id":"e819af53aeec7573","repo":"hibernate/hibernate-orm","slug":"unable-to-perform-unmarshalling-at-line-number-s","errorCode":null,"errorMessage":"Unable to perform unmarshalling at line number %s and column %s in %s %s. Message: %s","messagePattern":"Unable to perform unmarshalling at line number (.+?) and column (.+?) in (.+?) (.+?)\\. Message: (.+?)","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/JaxbCfgProcessor.java","lineNumber":111,"sourceCode":"\tprivate JaxbCfgHibernateConfiguration unmarshal(XMLEventReader staxEventReader, final Origin origin) {\n\t\tfinal XMLEvent event = xmlEvent( staxEventReader );\n\t\tif ( !isNamespaced( event.asStartElement() ) ) {\n\t\t\t// if the elements are not namespaced, wrap the reader in a reader which will namespace them as pulled.\n\t\t\tBOOT_LOGGER.cfgXmlDocumentDidNotDefineNamespaces();\n\t\t\tstaxEventReader = new NamespaceAddingEventReader( staxEventReader, HIBERNATE_CONFIGURATION_URI );\n\t\t}\n\n\t\tfinal var handler = new ContextProvidingValidationEventHandler();\n\t\ttry {\n\t\t\tfinal var unmarshaller =\n\t\t\t\t\tJAXBContext.newInstance( JaxbCfgHibernateConfiguration.class )\n\t\t\t\t\t\t\t.createUnmarshaller();\n\t\t\tunmarshaller.setSchema( schema() );\n\t\t\tunmarshaller.setEventHandler( handler );\n\t\t\treturn (JaxbCfgHibernateConfiguration) unmarshaller.unmarshal( staxEventReader );\n\t\t}\n\t\tcatch ( JAXBException e ) {\n\t\t\tthrow new ConfigurationException(\n\t\t\t\t\t\"Unable to perform unmarshalling at line number \" + handler.getLineNumber()\n\t\t\t\t\t\t\t+ \" and column \" + handler.getColumnNumber()\n\t\t\t\t\t\t\t+ \" in \" + origin.getType().name() + \" \" + origin.getName()\n\t\t\t\t\t\t\t+ \". Message: \" + handler.getMessage(), e\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static XMLEvent xmlEvent(XMLEventReader staxEventReader) {\n\t\ttry {\n\t\t\tXMLEvent event = staxEventReader.peek();\n\t\t\twhile ( event != null && !event.isStartElement() ) {\n\t\t\t\tstaxEventReader.nextEvent();\n\t\t\t\tevent = staxEventReader.peek();\n\t\t\t}\n\t\t\tif ( event == null ) {\n\t\t\t\tthrow new HibernateException( \"Could not locate root element\" );\n\t\t\t}","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/JaxbCfgProcessor.java#L93-L129","documentation":"Error \"Unable to perform unmarshalling at line number %s and column %s in %s %s. Message: %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"JAXB cannot parse the XML configuration document.","commonSituations":"Malformed or schema-violating hibernate.cfg.xml content, or a document missing its expected root element.","solutions":["Validate the cfg.xml against the hibernate-configuration XSD at the reported line/column; fix the malformed element or attribute.","Check for unclosed tags, invalid characters, or wrong namespaces in the XML.","Compare the file against a known-good hibernate.cfg.xml template."],"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"}