验证controller层报异常
来源:2-10 验证Controller
appleday
2021-04-07
之前的dao层和service层的junit测试均通过,但是输入localhost:8080/schoolshops/superadmin/listarea出现异常信息
{"errMsg":"org.mybatis.spring.MyBatisSystemException: 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 java.sql.SQLException: Connections could not be acquired from the underlying database!\r\n### The error may exist in file [E:\\apache-tomcat-8.5.64\\webapps\\SchoolShops\\WEB-INF\\classes\\mapper\\AreaDao.xml]\r\n### The error may involve com.ahu.schoolshop.dao.AreaDao.queryArea\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!","succes":false}
我的数据库名称是schoolshops
Jdbc的配置文件内容为
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/schoolshops?useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=root
1回答
-
翔仔
2021-04-07
同学好,这里是不是用了mysql8 驱动是否已按照升级章节升级了 直接用这里的账号密码连接mysql是否能连上。
052021-04-10
相似问题