org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaRibbonClientConfiguration': Unsatisfied dependency expressed through field 'eurekaConfig'; nested exception is 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!)
问题:突然有一天Jenkins部署项目失败,打包成功但是项目未能启动成功
首先网上查阅了资料说是端口占用的可能,可是用root账号查看了下,是没问题的,于是拉测试环境的代码本地启动,发现是正常启动成功的,且注册到了注册中心,于是重新部署试试看,还是失败的,尝试本地打包测试环境代码丢到服务器,然后启动jar包,查看日志发现是启动成功的,也成功注册到注册中心上。
初步怀疑是Jenkins打的jar有问题,本地打的是没问题的,多次尝试无果
最终请假项目技术大牛,他本地启动项目是报错的,有个依赖jar包冲突了,于是在pom文件里增加排除了下冲突的jar就可以了
而我本地能启动项目成功的原因估计是我本地仓库没有发生冲突的依赖jar,而公司的项目仓库是有的
排除冲突依赖后重新使用jenkins部署,成功!