Spring boot 整合Activiti中遇到的问题

摘要:
--mysql驱动--˃mysqlmysql-connector-java5.1.38#连接信息application.propertiesspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/jt?
 Pom.xml 配置
<!-- activiti --> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-spring-boot-starter-basic</artifactId> <version>6.0.0</version> </dependency> <!-- mysql 驱动 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.38</version> </dependency>
#连接信息application.properties
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/jt?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=root
spring.activiti.check-process-definitions: false
SpringBoot启动
启动报错
1、org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.activiti.spring.boot.SecurityAutoConfiguration': Initialization of bean failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy;
2、org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource 
解决办法:启动类上加上 @SpringBootApplication(exclude = SecurityAutoConfiguration.class)即可;因为activiti-spring-boot-starter-basic中引用了spring-boot-starter-security
No.2
启动报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springProcessEngineConfiguration' defined in class path resource [xxxxx/xxxx/xxx.java]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.spring.SpringProcessEngineConfiguration]: Factory method 'springProcessEngineConfiguration' threw exception; nested exception is java.io.FileNotFoundException: class path resource [processes/] cannot be resolved to URL because it does not exist;

意思是在resource下没有找到processes文件夹;

解决办法:在resource目录下添加processes文件夹,并且文件夹不能为空 或是在application.properties文件中加上如下配置(注意是spring节点下)
activiti:
    database-schema-update: true
    # 自动部署验证设置:true-开启(默认)、false-关闭
    check-process-definitions: false;

No.3

启动报错

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'runtimeServiceBean' defined in class path resource [com/example/config/ActivitiConfig.class]: Unsatisfied dependency expressed through method 'runtimeServiceBean' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.

解决办法:配置数据源时url前加上jdbc-;如:jdbc-url: jdbc:mysql://localhost:3306/activity?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8

No.4启动报错:
Error querying database. Cause: java.sql.SQLSyntaxErrorException
解决方法: (1)把mysql8.0的版本改成5.0的 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.41</version> </dependency>(2)修改驱动: com.mysql.jdbc.Driver

免责声明:文章转载自《Spring boot 整合Activiti中遇到的问题》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇各种分布式文件系统的比较概率生成函数下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

activiti 工作流

1. 工作流的概念 工作流(Workflow),就是“业务过程的部分或整体在计算机应用环境下的自动化”,它主要解决的是“使在多个参与者之间按照某种预定义的规则传递文档、信息或任务的过程自动进行,从而实现某个预期的业务目标,或者促使此目标的实现”。 工作流管理系统(Workflow Management System, WfMS)是一个软件系统,它完成工作量...

jbpm 6 vs activities 5评估(持续更新、亲测实际项目评估)

最近我们有个使用了jbpm 6.2(6.2是一个较大的里程碑)的批处理模块,因为大BOSS一直觉得太重了,希望有更加轻量级的解决方案,因为我们基本上没有真正意义上流程的概念,只有静态的流程图,因为一直忙于其他事情,于是这周才正式开始研究jbpm的一些细节(前几年很多支持的项目中也接触过,不过更多的是解决一些故障类问题,本身对流程类的不感冒)。顺便研究了下j...

Activiti-个人任务

1.分配任务负责人  1.1 固定分配     在进行业务流程建模时指定固定的任务负责人;          在properties视图中,填写Assignee项为任务负责人;     注意事项:由固定分配方式,任务只管一步一步执行任务,执行到每一个任务将按照bpmn的配置去分配任务负责人;   1.2 表达式分配     1.2.1 UEL表达式    ...

Activiti工作流引擎数据库表结构

1、 数据库的命名     Acitiviti数据库中表的命名都是以ACT_开头的。第二部分是一个两个字符用例表的标识。此用例大体与服务API是匹配的。 l ACT_RE_*:’RE’表示repository。带此前缀的表包含的是静态信息,如,流程定义,流程的资源(图片,规则等)。 l ACT_RU_*:’RU’表示runtime。这是运行时的表存储着流程...

Activiti如何替换已部署流程图

  首先交代下背景:我们有一个已经上线的activiti工作流系统,对于流程图的操作已经封装好部署,查看,删除的接口。此时客户提出要修改个别流程图里的节点名称。   我的第一个想法就是本地修改流程图bpmn文件,然后去客户端先调用删除接口删除旧流程图,然后调用部署接口添加修改后的流程图,然而事实上,因为系统已经上线,此时存在大量运行中的工作流数据,一旦执行...

IDEA创建Activiti工作流开发

一、 安装Activiti插件 1. 首先打开FIle的setting功能,搜索Plugins:    2. 输入actiBPM,然后点击搜索: 3. 点击安装、应用: 安装好之后点击apply(应用),之后重启idea 二、 创建Activiti工作流并导出流程图图片 1. 重启IDEA之后,点击File文件中的New下的BpmnFile:...