Skip to content

修复Spring Boot2.1.0版本问题

Compare
Choose a tag to compare
@yinjihuan yinjihuan released this 17 Jan 14:04
· 18 commits to master since this release
7ce2dac

Spring Boot为2.1.0版本时启动会报下面的错误:

Description:

The bean 'jobConfParser', defined in class path resource [com/cxytiandi/elasticjob/autoconfigure/JobParserAutoConfiguration.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/Users/yinjihuan/.m2/repository/com/github/yinjihuan/elastic-job-spring-boot-starter/1.0.2/elastic-job-spring-boot-starter-1.0.2.jar!/com/cxytiandi/elasticjob/parser/JobConfParser.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

可以设置spring.main.allow-bean-definition-overriding=true临时解决,原因是新版本中不允许有相同的BeanName。这个版本修复了这个问题,根据jobName创建SpringJobScheduler