用 jboos 配置数据源连接数据库时,在长时间没有操作数据库后,再次操作数据库会出现java.lang.reflect.InvocationTargetException警告,大致警告内容如下:
WARN [org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker] (http--10.8.221.69-8080-4) Unexpected error: java.lang.reflect.InvocationTargetException
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 5,096,711 milliseconds ago. The last packet sent successfully to the server was 930,460 milliseconds ago.
...
Caused by: java.net.SocketException: 连接超时
...
WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (http--10.8.221.69-8080-4) Destroying connection that is not valid, due to the following exception: com.mysql.jdbc.JDBC4Connection@160d09ec: java.sql.SQLException: Ping failed: java.lang.reflect.InvocationTargetException
...
WARN [org.jboss.jca