Spring Cloud采坑记录

一、Caused by: java.lang.ClassNotFoundException: feign.Feign$Builder

原因:没有引用jar包

在pom文件引用jar


   org.springframework.cloud
   spring-cloud-starter-feign

二、使用fegin时,编写service调用服务接口,启动报错

Spring Cloud采坑记录_第1张图片

出现以下错误:



Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-03-13 15:04:06.698 ERROR 14736 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 


***************************
APPLICATION FAILED TO START
***************************


Description:


Field demoFeignClient in org.crazyit.cloud.TestController required a bean of type 'org.crazyit.client.DemoFeignClient' that could not be found.




Action:


Consider defining a bean of type 'org.crazyit.client.DemoFeignClient' in your configuration.


Disconnected from the target VM, address: '127.0.0.1:10453', transport: 'socket'


错误原因:fegin调用所在包没有被扫描到,在项目启动时,注解添加扫描包

Spring Cloud采坑记录_第2张图片

你可能感兴趣的:(Spring Cloud采坑记录)