求助:feign集成sentinel启动异常

来源:8-16 Feign整合Sentinel

慕侠7427765

2021-05-08

图片描述图片描述
图片描述
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
’shareController’ defined in file [D:\Project\project-path\alibaba\content-center\target\classes\com\yk\contentcenter\controller\content\ShareController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘shareService’: Unsatisfied dependency expressed through field ‘userCenterFeignClient’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.yk.contentcenter.feignclient.UserCenterFeignClient’: FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1206) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar:5.3.3]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar:5.3.3]

写回答

4回答

大目

2021-05-20

视频《4-2 版本与兼容性》 一节,专门花了15分钟讲版本兼容性,这一节不是废话哈……

前前后后至少有20个同学遇到类似问题了……

0
0

老冯123123

2021-05-17

请问这个是怎么解决的  我这也遇到了

0
1
老冯123123
额,解决了,spring-cloud-alibaba-dependencies应该是2021.1,spring-cloud-dependencies版本应该是2020.0.1
2021-05-17
共1条回复

慕侠7427765

提问者

2021-05-09

版本的问题,已经解决了,打扰
0
1
大目
不好意思,问题被顶到追问里面去了,刚看到。解决就好哦^_^加油!
2021-05-14
共1条回复

慕侠7427765

提问者

2021-05-08

大木老师您好:项目在没有开启feign.sentinel.enabled=true的时候可以正常启动。 在直接使用resttemplate集成sentinel的时候测试也是正常的。 


0
0

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

3054 学习 · 1322 问题

查看课程