Spring错误日志:
困扰时长:两天左右
解决方法:
1.反复看百度和goolge上遇到相似问题的解决方案。
2.反复对照配置文件是否有问题。
错误日志如下:
Closing non transactional SqlSession
[org.apache.ibatis.session.defaults.DefaultSqlSession@46f86a7c]
org.mybatis.spring.MyBatisSystemException: nested exception is
org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause:
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC
Connection; nested exception is java.sql.SQLException: com.mysql.jdbc.Driver
The error may exist in file [W:\tomcat_server\apache-tomcat-
7.0.70\webapps\webgateNew\WEB-INF\classes\sqlMapperXml\SysAccountMapper.xml]
The error may involve
cn.digitalpublishing.mapper.system.SysAccountMapper.getByUidAndPwd
The error occurred while executing a query
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
JDBC Connection; nested exception is java.sql.SQLException:
最终解决办法是从CSDN一位博主上弄下来的(https://blog.csdn.net/u012246342/article/details/62048704)为:
更新jar包:
在 pom.xml 中,加入 mysql 的 maven 引用。
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>