'Hibernate 3.5 throws "org.dom4j.DocumentException: Error on line 1 of document http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd

I have some Hibernate 3.5 tests in my Hypersistence Optimizer code base, and I'm now getting this weird error:

org.hibernate.InvalidMappingException: Could not parse mapping document from resource hbm/mapping/association/EagerFetchingManyToOneFetchJoinHbmTest.hbm.xml

    at org.hibernate.cfg.Configuration.addResource(Configuration.java:671)
    at io.hypersistence.optimizer.util.AbstractHypersistenceOptimizerTest.newSessionFactory(AbstractHypersistenceOptimizerTest.java:108)
    at io.hypersistence.optimizer.util.AbstractHypersistenceOptimizerTest.init(AbstractHypersistenceOptimizerTest.java:63)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:610)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:668)
    ... 25 more
Caused by: org.dom4j.DocumentException: Error on line 1 of document http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
    at org.dom4j.io.SAXReader.read(SAXReader.java:482)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:601)
    ... 26 more

All these tests ran just fine for 3 years, so this may be a change that happened lately.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source