MapStruct - Couldn‘t retrieve @Mapper annotation

简介: MapStruct - Couldn‘t retrieve @Mapper annotation

报错信息

java: Couldn't retrieve @Mapper annotation


原因分析

  1. Maven Pom 切换 MapStruct 版本的时候旧版本残留,没有清理干净,刷新下 Maven;
  2. 与 springfox-swagger2 冲突,该框架里也包含 mapstruct,如下解决方案。


解决方案

<dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>${swagger2.version}</version><scope>compile</scope><exclusions><exclusion><groupId>org.mapstruct</groupId><artifactId>mapstruct</artifactId></exclusion></exclusions></dependency>
目录
相关文章
|
5月前
|
Java
Mapper that could not be found
Mapper that could not be found
58 0
|
7月前
|
Java 数据库
SpringBoot整合es7.x启动报错:Rejecting mapping update to [AAA] as the final mapping would have more than 1
SpringBoot整合es7.x启动报错:Rejecting mapping update to [AAA] as the final mapping would have more than 1
137 1
|
6月前
|
XML 数据格式
Could not autowire. No beans of ‘VideoDao‘ type found.
Could not autowire. No beans of ‘VideoDao‘ type found.
|
6月前
|
Java 数据库连接 Maven
Could not autowire. No beans of ‘ArticleMapper‘ type found. 要添加Mybatis的依赖
Could not autowire. No beans of ‘ArticleMapper‘ type found. 要添加Mybatis的依赖
|
8月前
No qualifying bean of type [com.XX.mapper.SysNameMapper ] found for dependency
No qualifying bean of type [com.XX.mapper.SysNameMapper ] found for dependency
100 0
|
Java 数据库连接 mybatis
mybatis报错:Type handler was null on parameter mapping or property ‘__frch_xxx_0’
mybatis报错:Type handler was null on parameter mapping or property ‘__frch_xxx_0’
2129 0
mybatis报错:Type handler was null on parameter mapping or property ‘__frch_xxx_0’
|
NoSQL Java Redis
5. 成功解决:Could not autowire. No beans of 'RedisConnectionFactory' type found.
今天建了一个新项目,使用 Spring Boot 整合 Redis 时,IDEA 被提醒“Could not autowire. No beans of 'RedisConnectionFactory' type found. ”错误,意思是不能自动装配“RedisConnectionFactory”。
3294 1
|
Java
springboot3 解决:Could not autowire. No beans of ‘JavaMailSender‘ type found
因为 spring-boot-starter-mail 默认使用某些包发生了变化,在 2.2.xx 版本前后不一,解决对应bug
512 0
Field userDao in com.sd.sbmb.service.impl.UserServiceImpl required a bean of type ‘com.sd.sbmb.dao.U
Field userDao in com.sd.sbmb.service.impl.UserServiceImpl required a bean of type ‘com.sd.sbmb.dao.U
233 0
|
Java 编译器
Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.已解决
在创建redisTemplate时,形参列表爆出了如下错误
1217 0
Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.已解决