项目启动失败

来源:1-5 快速入门小例子

qq_慕前端6234595

2021-10-08 01:07

我使用的Idea,步骤和代码跟老师的一样,结果项目就是启动不起来,下面的是定位到的错误信息:
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

看了前面的相关回答说是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


写回答 关注

1回答

  • Lucibriel
    2021-10-20 15:18:34

    看看数据库是什么版本,你的驱动对应的是哪个版本

MyBatis-Plus入门

MyBatis-Plus框架入门必学课程!

55539 学习 · 381 问题

查看课程

相似问题