搭建SSM項目時報錯(org.springframework.jdbc.CannotGetJdbcConnectionException)


嚴重: 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的時候,末尾不能有空格存在,要刪掉所有的多余空格

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM