- 错误1:
代码生成器依赖和mybatis依赖冲突
- 启动项目时报错如下
| 2021-12-03 13:33:33.927 ERROR 7228 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : |
| |
| *************************** |
| APPLICATION FAILED TO START |
| *************************** |
| |
| Description: |
| |
| An attempt was made to call a method that does not exist. The attempt was made from the following location: |
| |
| org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:564) |
| |
| The following method did not exist: |
| |
| org.apache.ibatis.session.Configuration.setDefaultEnumTypeHandler(Ljava/lang/Class;)V |
| |
| The method's class, org.apache.ibatis.session.Configuration, is available from the following locations: |
| |
| jar:file:/C:/repo/maven/org/mybatis/mybatis/3.4.4/mybatis-3.4.4.jar!/org/apache/ibatis/session/Configuration.class |
| |
| The class hierarchy was loaded from the following locations: |
| |
| org.apache.ibatis.session.Configuration: file:/C:/repo/maven/org/mybatis/mybatis/3.4.4/mybatis-3.4.4.jar |
| |
- 错误原因:如下
代码生成器依赖
和mybatis依赖
冲突
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.4.4</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.mybatis.generator</groupId> |
| <artifactId>mybatis-generator-core</artifactId> |
| <version>1.3.5</version> |
| </dependency> |
| ———————————————————————————————————————————————————— |
| <dependency> |
| <groupId>org.mybatis.spring.boot</groupId> |
| <artifactId>mybatis-spring-boot-starter</artifactId> |
| <version>1.3.2</version> |
| </dependency> |
| <dependency> |
| <groupId>com.alibaba</groupId> |
| <artifactId>druid-spring-boot-starter</artifactId> |
| <version>1.1.10</version> |
| </dependency> |
- 错误2:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
| |
| |
| |
| |
| |
| |
| |
| <resources> |
| <resource> |
| <directory>src/main/java</directory> |
| <includes> |
| <include>**/*.xml</include> |
| </includes> |
| </resource> |
| </resources> |
- 错误3:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptsController': Unsatisfied dependency expressed through field 'deptService';
| 项目详情:cloud项目的子模块使用mybatis,之后又集成了mybatis plus, |
| 错误原因1:项目中有多个实体类文件夹,https://blog.csdn.net/csdn_tingou/article/details/84872046 |
| 错误原因2:包名实现类等是否正确,https://blog.csdn.net/qq_41581154/article/details/101123221?ops_request_misc=&request_id=&biz_id=102&utm_term=org.springframework.beans.fact&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-101123221.nonecase&spm=1018.2226.3001.4187 |
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
2021-07-22 ubuntu入门