? ? "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.? Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n### The error may exist in com/imooc/mapper/UsersMapper.java (best guess)\r\n### The error may involve com.imooc.mapper.UsersMapper.selectOne\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.",
2018-12-05
如果配置了數(shù)據(jù)源不能連接,報(bào)這個(gè)
{
? ? "timestamp": "2018-12-05T02:54:43.951+0000",
? ? "status": 500,
? ? "error": "Internal Server Error",
? ? "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.? Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.\r\n### The error may exist in com/imooc/mapper/UsersMapper.java (best guess)\r\n### The error may involve com.imooc.mapper.UsersMapper.selectOne\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.",
}
就去檢查數(shù)據(jù)源配置信息
2018-06-27
導(dǎo)入org.mybatis.spring.annotation.MapperScan服務(wù)器報(bào)和你一樣的錯(cuò),換成tk.mybatis.spring.annotation.MapperScan,服務(wù)器響應(yīng)超級(jí)慢,然后最后報(bào)個(gè)500
2018-05-14
在項(xiàng)目中搜索BaseInsertProvider 這個(gè)類,發(fā)現(xiàn)只有
這個(gè)包中有,改為導(dǎo)入該類。
2018-05-11
把SpringBoot的Application啟動(dòng)類的@MapperScan注解導(dǎo)入包換成import org.mybatis.spring.annotation.MapperScan;試一下