欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SSH 整合报错org.dom4j.DocumentException

程序员文章站 2022-04-13 21:37:30
...

Caused by: org.dom4j.DocumentException: http://hibernate.org/dtd/hibernate-mapping-3.0.dtd%20 Nested exception: http://hibernate.org/dtd/hibernate-mapping-3.0.dtd%20

	at org.dom4j.io.SAXReader.read(SAXReader.java:484)

	at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:75)

	... 20 more
原因:在自动生成的XML的映射文件的头信息中,3.0dt后面有个空格
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">

将空格去掉

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">