原因：You're probably running into the fact that MYSQL closes connections which have been open "too long". Probably if you make the request to the server again, you'll find that it works because the connection is reopened.

解决方法：One way to deal with this is to add the following to your context.xml Resource:

validationQuery="select 1"

代价：This causes a very cheap test query to always be run first; if the connection has been closed, this gets the failure, and then a new connection is opened