Spring Boot 项目启动报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'creditAccountController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'creditAccountServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'redisUtil' is expected to be of type 'com.hundsun.ifs.middle.account.analyze.industrial.server.service.RedisUtils' but was actually of type 'com.hundsun.ifs.common.core.cache.RedisUtil'
问题点
可能是两个相互依赖的类又 注入了相同的依赖
例如我这里报错的原因: RedisUtils 里面注入了依赖@RedisUtil redisUtil,然后当别的实现类引用RedisUtils时,注入依赖@RedisUtils redisUtil这样的话就导致了依赖循环注入,需要修改,不能同名引入