首页 > 系统服务 > 详细

hibernate 的 org.dom4j.DocumentException: Connection timed out 问题

时间:2014-06-05 08:48:35      阅读:443      评论:0      收藏:0      [点我收藏+]


hibbernate的异常的一种情况


一开始以为是数据库连接问题。。。。错了

Communication failure during handshake. Is there a server running on localhost:3306?这个才是数据库连接问题

---特别要注意版本对应,这种问就出现在下面了

问题定位:

org.dom4j.DocumentException: Connection timed out

Connection timed out: connect Nested exception: Connection timed out: connect

出现这个异常的原因之一是读取配置文件超时。


通常是在读取hibernate配置文件验证dtd时版本不对造成的。所以在生成hibernate配置文件的时候要注意配置文件的dtd版本。根据相应的hibernate.jar版本,生成对应的hbm.cfg.xml

如果出现以上异常 可以试下

<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

转换试下

<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

又或者是反过来!

hibernate 的 org.dom4j.DocumentException: Connection timed out 问题,布布扣,bubuko.com

hibernate 的 org.dom4j.DocumentException: Connection timed out 问题

原文:http://blog.csdn.net/qq635785620/article/details/27488105

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!