1. 程式人生 > >Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframewo

Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframewo

https://blog.csdn.net/StriverChuiYing/article/details/81749793

 

Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaInstanceConfigBean': 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!)

這是因為client裡不包含Tomcat的依賴,所以Spring容器無法建立一些例項,從而導致專案無法啟動,只需在pom.xml檔案中,加上web依賴即可:

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>