我使用的Idea,步驟和代碼跟老師的一樣,結(jié)果項目就是啟動不起來,下面的是定位到的錯誤信息:
2021-10-08?00:49:28.686?ERROR?4612?---?[???????????main]?o.s.boot.SpringApplication???????????????:?Application?run?failedorg.springframework.beans.factory.BeanCreationException:?Error?creating?bean?with?name?'userMapper'?defined?in?file?[D:\first\target\classes\com\mp\dao\UserMapper.class]:?Invocation?of?init?method?failed;?nested?exception?is?java.lang.IllegalArgumentException:?Property?'sqlSessionFactory'?or?'sqlSessionTemplate'?are?required
看了前面的相關(guān)回答說是application.yml配置問題
這是application.yml配置?????
spring:
??datasource:
???driver-class-name:?com.mysql.jdbc.Driver
???url:?jdbc:mysql://localhost:3306/mp?useSSL=false&serverTimezone=GMT%2B8
???username:?root
???password:?xxxx
2021-10-20
看看數(shù)據(jù)庫是什么版本,你的驅(qū)動對應(yīng)的是哪個版本