spring boot 项目启动报错:原因一般是注入了相同名字的service

 -- :: com.gxcards.mes.MainWwwWeb: logStartupProfileInfo INFO: No active profile set, falling back to default profiles: default
-- :: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext: prepareRefresh INFO: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@: startup date [Thu Aug :: CST ]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@764faa6
-- :: org.springframework.beans.factory.support.DefaultListableBeanFactory: registerBeanDefinition INFO: Overriding bean definition for bean 'restTemplate' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=; dependencyCheck=; autowireCandidate=true; primary=false; factoryBeanName=restTemplateConfiguration; factoryMethodName=restTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/gxcards/mes/config/RestTemplateConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=; dependencyCheck=; autowireCandidate=true; primary=false; factoryBeanName=mainGoodsService; factoryMethodName=restTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/gxcards/mes/MainGoodsService.class]]
-- :: org.springframework.beans.factory.support.DefaultListableBeanFactory: registerBeanDefinition INFO: Overriding bean definition for bean 'restTemplate' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=; dependencyCheck=; autowireCandidate=true; primary=false; factoryBeanName=mainGoodsService; factoryMethodName=restTemplate; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/gxcards/mes/MainGoodsService.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=; dependencyCheck=; autowireCandidate=true; primary=false; factoryBeanName=mainWwwWeb; factoryMethodName=restTemplate; initMethodName=null; destroyMethodName=(inferred); defined in com.gxcards.mes.MainWwwWeb]
-- :: org.springframework.boot.SpringApplication: reportFailure ERROR: Application startup failed
java.lang.UnsupportedOperationException
at java.util.AbstractCollection.add(AbstractCollection.java:)
at java.util.AbstractCollection.addAll(AbstractCollection.java:)
at org.springframework.boot.web.servlet.ServletComponentScanRegistrar.updatePostProcessor(ServletComponentScanRegistrar.java:)
at org.springframework.boot.web.servlet.ServletComponentScanRegistrar.registerBeanDefinitions(ServletComponentScanRegistrar.java:)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at com.gxcards.mes.MainWwwWeb.main(MainWwwWeb.java:)
-- :: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext: doClose INFO: Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@: startup date [Thu Aug :: CST ]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@764faa6
-- :: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext: doClose WARN: Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@: startup date [Thu Aug :: CST ]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@764faa6
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at com.gxcards.mes.MainWwwWeb.main(MainWwwWeb.java:)
-- :: org.springframework.beans.factory.support.DefaultListableBeanFactory: destroyBean ERROR: Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@: startup date [Thu Aug :: CST ]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@764faa6
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:)
at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:)
at com.gxcards.mes.MainWwwWeb.main(MainWwwWeb.java:)
Disconnected from the target VM, address: '127.0.0.1:61286', transport: 'socket'

说是在项目中有了相同的 Overriding bean definition for bean 'restTemplate',原来是在我的这个项目的pom文件中引用了另一个项目,另一个项目也注入有restTemplate,导致启动报错。把本项目中的引用的另一个项目删除就解决了。

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context 错误的更多相关文章

  1. eclipse启动报错java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' befo

    报错: java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invo ...

  2. java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Oct 01 16:32:37 CS

    使用idea工具更改项目包名时报 :java.lang.ClassNotFoundException 解决方案: 1.删除项目的target目录,这个目录存放的是编译后的文件 2.清除缓存 3.重新编 ...

  3. java.lang.IllegalStateException: ApplicationEventMulticaster not initialized

    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- ...

  4. 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext这个问题

    今天在运行别人的SSH项目时,遇到了这个问题 严重: Exception sending context initialized event to listener instance of class ...

  5. java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

    spring的项目中有时候会报错:java.lang.IllegalStateException: BeanFactory not initialized or already closed - ca ...

  6. 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext问题

    使用ClassPathXmlApplicationContext加载项目时, ClassPathXmlApplicationContext context = new ClassPathXmlAppl ...

  7. 项目启动异常,java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo ...

  8. ApplicationEventMulticaster not initialized - call 'refresh' before

    https://stackoverflow.com/questions/45318618/applicationeventmulticaster-not-initialized-call-refres ...

  9. Tomcat启动之异常java.lang.IllegalStateException

    严重: Exception sending context destroyed event to listener instance of class org.springframework.web. ...

随机推荐

  1. PAT (Basic Level) Practice (中文)1022 D进制的A+B

    1022 D进制的A+B 输入两个非负 10 进制整数 A 和 B (≤2^30^−1),输出 A+B 的 D (1<D≤10)进制数. 输入格式: 输入在一行中依次给出 3 个整数 A.B 和 ...

  2. TypeError: '_io.TextIOWrapper' object does not support item assignment

    纯小白 遇到的细节问题: 报错 一开始看到这个傻逼了 TypeError: '_io.TextIOWrapper' object does not support item assignment 其实 ...

  3. Linux实战

    1.root用户无法删除文件 [root@VM_0_9_centos .ssh]# lsattr authorized_keys ----i----------- authorized_keys ls ...

  4. maven配置国内阿里云镜像

    <mirrors> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> ...

  5. 服务器被疑似挖矿程序植入,发现以及解决过程(建议所有使用sonatype/nexus3的用户清查一下)

    此次服务器被植入挖矿程序发现起来较为巧合,首先是上周三开始,我通过sonatype/nexus3搭建的仓库间歇性崩溃,但是每次重新start一下也能直接使用所以没有彻底清查,去docker logs里 ...

  6. Cookie写不进去问题深入调查 https Secure Cookie

    Cookie写不进去问题深入调查 https Secure Cookie 什么情形下,Cookie 会写不进去?https Secure Cookie像是语法错误那种显而易见的就不用说了,除此之外你可 ...

  7. C++笔记整理(参考整理自各大博客)

    为什么构造函数不能是虚函数,析构函数往往是虚函数? 静态存储区.无论在那里构建,其过程都是两步:首先,分配一块内存:其次,调用构造函数.好,问题来了,如果构造函数是虚函数,那么就需要通过vtable  ...

  8. Linux中LAMP构架的实现

    LAMP:Linux+Apache+Mysql+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度共同组 ...

  9. vue学习笔记—bootstrap+vue用户管理

    vue,读音view,简单易用的前端框架.特点如下: 1.一个mvvm的前端框架,内部做好了html中dom对象和后台用js语言定义的变量的双向绑定 2.中国人尤雨溪维护的个人项目,中文资料多,和go ...

  10. python:循环定义、赋值多个变量

    exec函数,可以循环定义.赋值多个变量 exec ("temp%s=1"%1)   这段代码的意思是,让exec执行temp1=1.字符串里面的%s由‘1’代替了. 我们在外面再 ...