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>
目录
相关文章
|
2月前
No qualifying bean of type [com.XX.mapper.SysNameMapper ] found for dependency
No qualifying bean of type [com.XX.mapper.SysNameMapper ] found for dependency
80 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’
1736 0
mybatis报错:Type handler was null on parameter mapping or property ‘__frch_xxx_0’
|
12月前
|
XML Java 程序员
Spring启动报错--class path resource [Beans.xml] cannot be opened because it does not exist
程序员不是在去生产bug的路上,那就是在去解决bug的路上。🤣🤣🤣🤣
123 1
|
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”。
2323 1
|
12月前
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
284 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
167 0
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sd.sbmb.dao.Use
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sd.sbmb.dao.Use
119 0
|
Java 编译器
Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.已解决
在创建redisTemplate时,形参列表爆出了如下错误
901 0
Could not autowire. No beans of ‘RedisConnectionFactory‘ type found.已解决
|
XML Java 数据库连接
springboot整合mybatis中:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
在项目的启动过程中如果出现:以下报错信息,则可以从以下几个方面入手排查问题。 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,这是第二次出现这种异常。我每次都是按照如下方法去逐一排查的,到最后都能解决问题。
685 0
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exception is org.springframewor
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exception is org.springframewor
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exception is org.springframewor