在springboot中使用elastic-job的时候项目启动异常:

2019-05-07 18:49:09.606  WARN 29958 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'elasticJobListener' defined in class path resource [com/daniel/ejob/JobConfig.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=jobConfig; factoryMethodName=elasticJobListener; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/daniel/ejob/JobConfig.class]] for bean 'elasticJobListener': There is already [Generic bean: class [com.daniel.ejob.ElasticJobListener]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/Users/houxiaoqiang/code/local/sbapp/sb-ejob/target/classes/com/daniel/ejob/ElasticJobListener.class]] bound.
2019-05-07 18:49:09.619  INFO 29958 --- [           main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-07 18:49:09.622 ERROR 29958 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

google之,发现是springboot2XX后的bean出现多个后造成的,一般bean的id不会重复,但是如果想覆盖的话可以

spring:main:allow-bean-definition-overriding: true

参考: https://www.cnblogs.com/duanxz/p/3748225.html

以上.

使用elastic-job 发生Invalid bean definition with name异常相关推荐

  1. Invalid bean definition with name ‘dataSourceCSS‘ dfined in class path resource[xxx]

    问题:Invalid bean definition with name 'dataSourceCSS' dfined in class path resource[aaa]:Could not re ...

  2. Spring Cloud Stream报错:Invalid bean definition with name:bean definition with this name already exist

    当想使用 Spring Cloud Stream 让微服务自己生产的消息自己消费时,如果使用的@Input("xxx")与@Output("xxx")注解中的& ...

  3. Spring错误——Spring 注解——factory-bean reference points back to the same bean definition

    背景:学习Spring,在使用注解@Bean的name属性配置<bean>实例时,不能注册实例成功 报错 WARNING: Exception encountered during con ...

  4. SpringBoot的Bean Definition 生成过程(源码分析)

    1.目的: 从源码的角度分析整个springboot的启动流程.了解springboot项目在整个启动过程都干了一些什么. 因为spring项目的启动主要是分为两步,一个是bean definitio ...

  5. Spring Boot: Bean definition overriding

    在本文中,我将讨论棘手的Spring Boot bean定义覆盖机制. 为了使您对该主题更加清楚,让我们从小测验开始.请看下一个简单的例子. 因此,我们有2种配置,它们使用名称beanName实例化b ...

  6. conflicts with existing, non-compatible bean definition of same name and class

    Annotation-specified bean name 'xxxxxImpl' for bean class [cn.abc.dao.service.xxxxxImpl] conflicts w ...

  7. non-compatible bean definition of same name and class [com.echo.util.FileUploadDispatcher]

    问题起因: 开发过程中更新代码 就报错了(整个项目运行不起来). 报错信息如下: Annotation-specified bean name 'fileUploadDispatcher' for b ...

  8. 运行web项目提示异常:non-compatible bean definition of same name and class【com.xxx.xxx.XXX】

    情景描述:报错提示non-compatible bean definition of same name and class[com.xxx.xxx.XXX]但在代码中并未发现指定的bean有冲突 原 ...

  9. vue cli3 使用vue-svg-loader 出现Invalid Component definition报错

    使用vue-svg-loader插件, 可以让svg格式的文件(比如图片),当成组件在项目中引入, 十分方便. 但是有时会出现"Invalid component definition&qu ...

最新文章

  1. SQL SERVER 分区表的总结--一些疑问的总结
  2. AI部署前路坎坷,50%项目半路夭折
  3. C++二叉堆binary heap (附完整源码)
  4. Linux系统编程--1(进程和程序,CPU和MMU,PCB,进程状态)
  5. Python使用wordnet工具计算词集与词条基本用法(二)
  6. MySQL中的索引使用
  7. 图论(二):图的割点(cut vertex)与连通度(connectivity)
  8. IQOO手机便签有哪些实用的小功能?
  9. Maya---基础知识总结
  10. 关于各种网站音频mp3的外链地址,真实的外链播放地址
  11. 芮城县县名由来 芮伯庙 古魏城 芮伯万 永乐县
  12. UE4利用Save Game创建全局变量
  13. 美国ZIP Code 一览表
  14. ZigBee学习之7——OSAL(操作系统抽象层)API解读
  15. Verilog实现正弦波、三角波、方波、锯齿波的输出
  16. JAVA避免使用魔法数值
  17. Linux云计算架构-docker容器命名和资源配额控制(2)
  18. 【激光与光电子进展投稿 记录】
  19. R语言-一个寻找R函数功能源码的好方法
  20. Android使用viewpager实现图片轮播效果

热门文章

  1. ISCXTor2016数据集(Tor-nonTor dataset)介绍
  2. 刘韧:陈一舟要我成为卓有成效的管理者
  3. 什么是Redis ?
  4. 油耳适合带什么耳机?不入耳的骨传导耳机最合适
  5. WordPress精仿小米社区简洁大气主题模板Misq
  6. 云游戏,光有5G就够了吗?
  7. 51单片机的定时/计数器
  8. 立体视觉入门指南(7):立体匹配
  9. IDEA EasyCode Oracle映射关系
  10. 亚马逊关键词首页排名技巧 让客户找到你