Wednesday, 20 June 2012

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx-3.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

Exception in spring roo generated application when run offline

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx-3.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

To identify the issue, take at look at maven dependency hierarchy and see the corresponding jar version from which the xsd is included. In my case, spring-security-web was referring to a 3.0.5 version of spring-tx that resulted in the exception.

I had to explicitly include 3.1.0 version of spring-tx in my pom file and the issue is gone.