Openshift MySQL “Communications Link Failure”

╄→гoц情女王★ 提交于 2019-12-12 04:59:03

问题


I get the following error message when trying to connect a web app running on EAP6 to MySQL in OpenShift.

javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Communications link failure

How do I fix this?


回答1:


The same issue was discussed at https://community.jboss.org/thread/202318.

The solution is to append "?autoReconnect=true" to the connection URL. You do this in the standalone.xml file, found in the .openshift/config folder in your OpenShift Maven project.


EDIT

This is actually a known bug: https://community.jboss.org/thread/177144. Validating the connection can be used as a workaround.

<validation>
 <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
</validation>


来源:https://stackoverflow.com/questions/11714042/openshift-mysql-communications-link-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!