Spring Cloud Feign fallback错误解决

今天在启动时报了下面这个错误

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fangjia.api.client.auth.AuthRemoteClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fangjia.api.client.auth.AuthRemoteClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.fangjia.api.client.auth.AuthRemoteClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name java.lang.StackOverflowError
	... 1024 common frames omitted

从错误信息看的出是递归导致的,而我这边报错的点是Feign调用的地方

最后排查下来发现是@FeignClient中fallback的值配置错了,应该配置接口的实现类,而我这边配置的就是接口本身,所以导致了递归调用。

欢迎加入我的知识星球,一起交流技术,免费学习猿天地的课程(http://cxytiandi.com/course)

PS:目前星球中正在星主的带领下组队学习Sentinel,等你哦!

微信扫码加入猿天地知识星球

猿天地

你可能感兴趣的:(spring,cloud)