Spring boot 2.1版本:Consider renaming one of the beans or enabling overriding by setting

今天搭建一个zuul,启动的时候报错,报错信息如下:

Description:

The bean 'counterFactory', defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulCounterFactoryConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$ZuulMetricsConfiguration.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

于是乎在applcation.properties中增加 spring.main.allow-bean-definition-overriding=true

 

结果报了另一个错:

It was loaded from the following location:

    file:/C:/Users/Administrator/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.6.RELEASE/spring-boot-autoconfigure-2.1.6.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.autoconfigure.web.ServerProperties$Servlet

 

后面继续在网上看,有人说是因为springboot改到了2.1.0版本,导致版本冲突,后来我把spring boot版本降为1.5,但是还是报其他错,但是改为2.0的版本就可以了:

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.0.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot整合Flowable可以通过引入相关依赖和配置文件来实现。 首先,在配置文件中需要设置以下几个属性: - `flowable.standalone.server.enabled=false`:禁用Flowable的独立服务器模式。 - `spring.main.allow-bean-definition-overriding=true`:允许Bean的覆盖。 - `flowable.async-executor-activate=false`:关闭定时任务的执行。 - `flowable.idm.enabled=false`:禁用身份信息的检测。 - `flowable.database-schema-update=false`:禁止生成数据库表。 其次,需要在pom.xml文件中引入Flowable和Xerces的相关依赖: ``` <!-- https://mvnrepository.com/artifact/org.flowable/flowable-spring-boot-starter --> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter</artifactId> <version>6.7.2</version> </dependency> <!-- https://mvnrepository.com/artifact/xerces/xercesImpl --> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> </dependency> ``` 最后,可以创建一个测试类,并注入所需的Flowable服务: ``` @RunWith(SpringRunner.class) @SpringBootTest(classes = BizApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class FlowableTest { @Autowired private RepositoryService repositoryService; @Autowired private RuntimeService runtimeService; @Autowired private TaskService taskService; @Autowired private HistoryService historyService; } ``` 通过以上步骤,就可以在Spring Boot项目中成功整合Flowable流程引擎。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [springboot整合flowable](https://blog.csdn.net/RenshenLi/article/details/124547710)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值