解决SpringBoot2集成Activiti6踩过的坑

1.activiti中的mybaitis版本冲突 错误信息
Caused by: java.lang.NoSuchFieldError: INSTANCE
    at com.baomidou.mybatisplus.MybatisMapperAnnotationBuilder.parseStatement(MybatisMapperAnnotationBuilder.java:332) ~[mybatis-plus-core-2.3.jar:?]
    at com.baomidou.mybatisplus.MybatisMapperAnnotationBuilder.parse(MybatisMapperAnnotationBuilder.java:153) ~[mybatis-plus-core-2.3.jar:?]
    at com.baomidou.mybatisplus.MybatisMapperRegistry.addMapper(MybatisMapperRegistry.java:86) ~[mybatis-plus-core-2.3.jar:?]
    at com.baomidou.mybatisplus.MybatisConfiguration.addMapper(MybatisConfiguration.java:101) ~[mybatis-plus-core-2.3.jar:?]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.bindMapperForNamespace(XMLMapperBuilder.java:408) ~[mybatis-3.4.2.jar:3.4.2]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:94) ~[mybatis-3.4.2.jar:3.4.2]
    at com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.buildSqlSessionFactory(MybatisSqlSessionFactoryBean.java:583) ~[mybatis-plus-core-2.3.jar:?]

经查,是因为我用mybatis plus,要求用mybatis3.4.6,而activiti用的是mybatis3.4.2,两边有冲突,直接排除activitiv那个即好:

<dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-spring-boot-starter-basic</artifactId>
            <version>6.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.mybatis</groupId>
                    <artifactId>mybatis</artifactId>
                </exclusion>
            </exclusions>
 </dependency>
2.activiti中的SecurityAutoConfiguration冲突启动项目中,报如下错
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) ~[?:1.8.0_181]
    at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) ~[?:1.8.0_181]
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) ~[?:1.8.0_181]
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) ~[?:1.8.0_181]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[?:1.8.0_181]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[?:1.8.0_181]
    at java.lang.Class.createAnnotationData(Class.java:3521) ~[?:1.8.0_181]
    at java.lang.Class.annotationData(Class.java:3510) ~[?:1.8.0_181]
    at java.lang.Class.createAnnotationData(Class.java:3526) ~[?:1.8.0_181]
    at java.lang.Class.annotationData(Class.java:3510) ~[?:1.8.0_181]
    at java.lang.Class.getAnnotation(Class.java:3415) ~[?:1.8.0_181]

经查,是类SecurityAutoConfiguration有冲突,在启动时排除该类即可

@Slf4j @EnableSwagger2 @SpringBootApplication(exclude = {SecurityAutoConfiguration.class}) //@EnableAutoConfiguration 这个需要注释掉不然上边的排除操作无效 public class JeecgApplication { public static void main(String[] args) throws UnknownHostException {

3.activiti中自动搜索流程文件的check-process-definitions问题

项目启动时报如下错误

  • activiti中自动搜索流程文件的check-process-definitions问题

    项目启动时报如下错误

Caused by: java.io.FileNotFoundException: class path resource [processes/] cannot be resolved to URL because it does not exist
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourceP

意思是说,在目录processes/寻找流程文件,这个只要配置一下check-process-definitions即好

spring:  
    activiti:
      database-schema-update: true
      check-process-definitions: false
收藏 (0)
评论列表
正在载入评论列表...
我是有底线的
为您推荐
    暂时没有数据