报错消息:
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file D:\应用安装处\tomcat1\webapps\carDomain\WEB-INF\classes\cn\edu\gxuwz\entity\Box.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:325)
at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:668)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:713)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 25 more
Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:311)
... 30 more
解决方案:
将实体类对于的映射文件(xxx.hbm.xml)头部信息修改,具体修改如下。
原来的:
<!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://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">