解决方法: 在application.properties添加配置 spring.datasource.druid.test-on-borrow=true spring.datasource.druid.test-while-idle=true