美文网首页Spring Cloud
Spring Cloud Feign fallback错误解决

Spring Cloud Feign fallback错误解决

作者: 尹吉欢 | 来源:发表于2017-11-28 14:30 被阅读206次

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

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的值配置错了,应该配置接口的实现类,而我这边配置的就是接口本身,所以导致了递归调用。

相关文章

网友评论

    本文标题:Spring Cloud Feign fallback错误解决

    本文链接:https://www.haomeiwen.com/subject/yxtebxtx.html