Tag Archives: SessionFactory

Hibernate reports an error. The configured sessionfactory cannot be found

The default hibernate DTD is used for recently written projects. This problem often occurs when starting projects. Hibernate reports an error, the ID of the configuration factory cannot be found, and the mapping configuration file cannot be found

Unable to read configuration XML file

Could not parse mapping document from input stream

……………

Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream

 …………..

Caused by: org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org

 …………..

After checking a lot of information, we finally found an effective solution:

In the xxx.hbm.xml configuration file corresponding to the POJO class, the“ http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd “> Replace with:

 

” http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd “, restart the project to solve the problem