@Bean
public Converter.Factory converterFactory() {
return Retrofit2ConverterFactory.create();
}
应用启动时警告日志,提示找不到Retrofit2ConverterFactory Bean
2022-12-13 09:44:51.306 [main] WARN c.g.l.r.spring.boot.util.AppContextUtils(AppContextUtils.java:26) - Failed to get bean from applicationContext!
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.alibaba.fastjson.support.retrofit.Retrofit2ConverterFactory' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at com.github.lianjiatech.retrofit.spring.boot.util.AppContextUtils.getBeanOrNew(AppContextUtils.java:23)
at com.github.lianjiatech.retrofit.spring.boot.core.RetrofitFactoryBean.lambda$createRetrofit$3(RetrofitFactoryBean.java:216)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at com.github.lianjiatech.retrofit.spring.boot.core.RetrofitFactoryBean.createRetrofit(RetrofitFactoryBean.java:215)
at com.github.lianjiatech.retrofit.spring.boot.core.RetrofitFactoryBean.getObject(RetrofitFactoryBean.java:67)
在配置文件中配置了转换工厂为fastjson的Retrofit2ConverterFactory
并且注册了Bean
应用启动时警告日志,提示找不到Retrofit2ConverterFactory Bean
如果找不到Bean的话,retrofit-spring-boot-starter是会用反射的方式获取的,因此这里并不影响功能。 不过不确定这是不是一个bug,请确认。