在刚启动过程中,大概启动1秒左右就出现如下错误。
s.c.a.CommonAnnotationBeanPostProcessor : 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!)
以上错误是由于pom文件缺少spring-boot-starter-web依赖jar。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
增加以上jar 完美解决。
解决错误问题。一定先要看清楚问题,现在百度中有很多人,看见一堆报错就各种尝试。这种解决方法是很不可取的。首先看清楚问题错误是否一样。再尝试方法。