一、Caused by: java.lang.ClassNotFoundException: feign.Feign$Builder
原因:没有引用jar包
在pom文件引用jar
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-feign</artifactId> </dependency>
二、使用fegin时,编写service调用服务接口,启动报错
出现以下错误:
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调用所在包没有被扫描到,在项目启动时,注解添加扫描包