LianjiaTech / retrofit-spring-boot-starter

A spring-boot starter for retrofit, supports rapid integration and feature enhancements.(适用于retrofit的spring-boot-starter,支持快速集成和功能增强)
Apache License 2.0
1.78k stars 340 forks source link

retrofit client客户端无法注入 : required a bean of type 'com.xxxx.cloud.rpc.xxxApi' that could not be found. #147

Closed shen0834 closed 1 year ago

shen0834 commented 1 year ago

Springboot version : 2.7.8 retrofit-spring-boot-starter version : 2.3.11

我试了2.3.8都无法注入,包括自己驱动org.springframework.boot.autoconfigure.AutoConfiguration.importscom.github.lianjiatech.retrofit.spring.boot.config.RetrofitAutoConfiguration 还是无法初始化


APPLICATION FAILED TO START


Description:

Parameter 1 of constructor in com.xxx.cloud.adapter.web.someBean required a bean of type 'com.xxxx.cloud.rpc.xxxApi' that could not be found.

Action:

Consider defining a bean of type 'com.xxxx.cloud.rpc.xxxApi' in your configuration.

shen0834 commented 1 year ago

大哥 , 你的@RetrofitScan 这个注解应该在文档里面说明一下,对于分层架构来说, scan the same base package as Spring Boot does 并不好用,最后还得自己翻源码来解决

feilongzait123 commented 3 months ago

大兄弟怎么解决的,我给这个注解单独指定到我的类都不生效