环境:Ubuntu server 12 + apache-tomcat-7 + mysql 5.5
描述:访问静态页面没有问题,访问数据库两次才能成功一次。
错误日志:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection timed out
STACKTRACE:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
检查一下防火墙设置看一下驱动有没有问题