严重: Servlet.service() for servlet [SpringMVC] in context with path [/ssm] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver  '

在搭建SSM项目时报错,一直提示Could not get JDBC Connection;

琢磨了好久才发现是jdbc.properties的文件写错了,如下:

driver=com.mysql.jdbc.Driver  
url=jdbc:mysql://localhost:3306/lin_test  
username=root  
password=123456  

在配置jdbc的时候,末尾不能有空格存在,要删掉所有的多余空格

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-20
  • 2021-04-27
  • 2021-05-19
  • 2018-03-12
猜你喜欢
  • 2021-12-24
  • 2021-09-23
  • 2021-09-25
  • 2022-12-23
  • 2021-04-11
  • 2021-12-21
  • 2021-05-08
相关资源
相似解决方案