当前位置:   article > 正文

【MyBatis-Plus问题集】当我们使用MyBatis-Plus版本3.5.x时,会发现一直无法注册xxxMapper_type com.baomidou.mybatisplus.extension.ddl.iddl n

type com.baomidou.mybatisplus.extension.ddl.iddl not present

项目场景

项目场景:我们想尝试新版本的MyBatis-Plus,使用目前比较新的版本3.5.3


问题描述

描述: 配置都确保正常且跟MyBatis-Plus官网配置一样后,启动项目时就会报错,无法找到xxxMapper,报错如下:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userServiceImpl’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [D:\learnData\java_learning\project\cloudsurvey\target\classes\cn\itsource\code\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration’: Initialization of bean failed; nested exception is java.lang.TypeNotPresentException: Type com.baomidou.mybatisplus.extension.ddl.IDdl not present

解决方案

缺少依赖,在pom.xml文件添加下面依赖

<!--引入mybatis-plus依赖-->
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>mybatis-plus-extension</artifactId>
  <version>3.5.3</version>
</dependency>
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>mybatis-plus-boot-starter</artifactId>
  <version>3.5.3</version>
</dependency>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/363932
推荐阅读
相关标签
  

闽ICP备14008679号