若依微服务使用openfeign ,写了一个接口,但是其他项目引入的时候显示找不到这个Bean:Could not autowire. No beans of 'RemoteHouseService' type found.
启动报错:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tokenController': Unsatisfied dependency expressed through field 'sysLoginService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysLoginService': Unsatisfied dependency expressed through field 'remoteHouseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tsthbpom.system.api.RemoteHouseService': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com.tsthbpom.system.api.factory.RemoteHouseFallbackFactory found for feign client remoteHouseServ
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysLoginService': Unsatisfied dependency expressed through field 'remoteHouseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tsthbpom.system.api.RemoteHouseService': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com.tsthbpom.system.api.factory.RemoteHouseFallbackFactory found for feign client remoteHouseService
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tsthbpom.system.api.RemoteHouseService': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No fallbackFactory instance of type class com.tsthbpom.system.api.factory.RemoteHouseFallbackFactory found for feign client remoteHouseService
Caused by: java.lang.IllegalStateException: No fallbackFactory instance of type class com.tsthbpom.system.api.factory.RemoteHouseFallbackFactory found for feign client remoteHouseService
idea 中代码提示:
Could not autowire. No beans of 'RemoteFileService' type found.
1.在系统接口api 中写了调用 house 服务的接口
2.在score 服务中,引入api,使用openfeign 调用house中的接
3.注入的是自己新写的remoteHouseService不行,但是原来的remoteFileService 就可以
4.api 自动配置文件中 加入新写的接口
参考:
springboot自动装配原理
【Spring Boot】自动配置及重要注解解析
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
2022-07-13 mysql 排序不正确
2022-07-13 vue表格使用v-html。自定义表格列显示得内容 el-table-column 中
2022-07-13 【SpringBoot - 整合并操作Oracle数据库教程(手动添加ojdbc驱动)】
2022-07-13 【若依框架】代码生成详细教程
2022-07-13 mysql double 使用_mysql使用double的坑