一,报错:

在引入完feign依赖,定义完FeignClient的接口后,启动项目,出现报错

大致报错为:

 ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itineraryController' defined in file [D:\ixxx\ItineraryController.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'itineraryServiceImpl' defined in file [D:\xxx\ItineraryServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'qianz.itineraryservice.client.DestinationClient': FactoryBean threw exception on object creation

AnnotationConfigApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'applicationTaskExecutor': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

二,解决方案:

加入负载均衡依赖

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐