spring-boot2集成Activiti6.0.0

启动时报:Error creating bean with name 'requestMappingHandlerMapping’错误的解决方法

demo项目结构如图:
spring-boot2集成Activiti6.0.0_第1张图片

一:pom.xml依赖jar配置:


	
		
			org.springframework.boot
			spring-boot-dependencies
			2.0.3.RELEASE
			pom
			import
		

		
		
			org.mybatis.spring.boot
			mybatis-spring-boot-starter
			1.3.2
		
		
			mysql
			mysql-connector-java
			8.0.11
		
		
		
			org.activiti
			activiti-spring-boot-starter-basic
			6.0.0
		
	



	
	
		org.springframework.boot
		spring-boot-starter-web
	
	
		org.springframework.boot
		spring-boot-starter-actuator
	
	
		org.springframework.boot
		spring-boot-starter-tomcat
	
	
		org.springframework.boot
		spring-boot-starter-aop
	
	
	
		org.springframework.boot
		spring-boot-starter-thymeleaf
	
	
	
		org.springframework.boot
		spring-boot-starter-test
		test
	

	
	
		org.mybatis.spring.boot
		mybatis-spring-boot-starter
	
	
		mysql
		mysql-connector-java
	

	
		org.activiti
		activiti-spring-boot-starter-basic
	

二:yml配置如图:
spring-boot2集成Activiti6.0.0_第2张图片
三:spring-boot启动入口类:
spring-boot2集成Activiti6.0.0_第3张图片
[注意图中标红部分,刚建项目时没有加图中标红部分,启动时一直报:Error creating bean with name 'requestMappingHandlerMapping’错误,上网查了好久一直未解决,最后发现只要加上以下配置:
@EnableAutoConfiguration(exclude = {
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
org.activiti.spring.boot.SecurityAutoConfiguration.class,
})

即可完美解决,原因是:
1.关闭security功能。因为activiti的依赖中含有spring security的jar包,所以springboot会自动配置安全功能,访问时就需要输入密码,导致启动失败
]

启动spring-boot后,自动会创建activiti的28张数据表:
spring-boot2集成Activiti6.0.0_第4张图片

你可能感兴趣的:(项目问题记录)