开发者社区 问答 正文

服务启动时连接Eureka报错?报错

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaAutoServiceRegistration': 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!)

展开
收起
爱吃鱼的程序员 2020-06-07 18:04:32 961 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>同一个服务重复启了</p>
    
                    
    
                                回复 <a class="referer" target="_blank">@Honey_Wang</a>  : 端口号也不能一样的。
                        
    
                            我现在单个服务只是测试,大概哪里重复使用了呢?
                        
    
                        <p>端口占用问题。我启动的端口是8082,window一查才发现端口居然被QQ给占用了,我也是很无语。。</p>
    
                    
    
                            兄嘚,十分感谢你的回答,解决了我的大问题,qq的tim程序占用了端口,十分感谢
                        
    
                        <p>你有找到问题吗?我的总在服务关闭时出现:</p>
    

     org.springframework.context.annotation.AnnotationConfigApplicationContext [994] - Exception thrown from ApplicationListener handling ContextClosedEvent
    org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaAutoServiceRegistration': 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!)

                            兄弟,解决了没,咋解决的
                        
    
                        <p>打包的时候不启动test的就行了,在pom.xml 文件下的properties 下加入 </p> 
    
    <properties>
        <skipTests>true</skipTests>

     

                        <p>我的原因是: 用到了 feign, 要加 spring-boot-starter-web 依赖, 编译不报错 启动报错</p>
    

     

    2020-06-07 18:04:46
    赞同 展开评论
问答地址: