ITeye博客

Communications link failure due to underlying exception:

涩勤荣 · 2010-10-21 20:55 · Java框架学习 · 企业架构 · Java · JDBC · MySQL · Hibernate · Markdown

21:00:34,207  WARN SettingsFactory:117 - Could not obtain connection metadata
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException

 

今天遇到了两次这个异常,查了很久,原来是在hibernate配置文件中的url 的端口设置错误,MySQL默认为3306.

<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate_page?characterEncoding=gbk</property>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。