spring boot java.lang.NoClassDefFoundError: org/springframework/cloud/context/named/NamedContextFact

错误:java.lang.NoClassDefFoundError: org/springframework/cloud/context/named/NamedContextFactory$Specification

代码

@SpringBootApplication
@EnableFeignClients
public class OpcApplication {
    public static void main(String[] args) {
        SpringApplication.run(OpcApplication.class, args);
    }
}

风.fox
原因:OpcApplication 中有注解@EnableFeignClients,但是在控制器或对外实现接口中,SpringBoot没有扫描到@FeignClient注解的程序

解决:要么给程序加注解@FeignClient,要么把 OpcApplication 中有注解@EnableFeignClients 暂时去掉

你可能感兴趣的:(java)