activiti的坑
maven配置:
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>7-201802-EA</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
代码:
public class ActivitiTest {
public static void main(String[] args) {
ProcessEngineConfiguration processEngineConfiguration =
ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
processEngineConfiguration.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/test4?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=true");
processEngineConfiguration.setJdbcDriver("com.mysql.cj.jdbc.Driver");
processEngineConfiguration.setJdbcUsername("root");
processEngineConfiguration.setJdbcPassword("");
processEngineConfiguration.setDatabaseSchema("ACT");
processEngineConfiguration.setDatabaseSchemaUpdate("drop-create");
processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
// RepositoryService repositoryService = processEngine.getRepositoryService();
// RuntimeService runtimeService = processEngine.getRuntimeService();
}
}
运行发生错误:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table 'test4.act_ge_property' doesn't exist
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntityImpl.selectProperty-Inline
### The error occurred while setting parameters
### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?
### Cause: java.sql.SQLSyntaxErrorException: Table 'test4.act_ge_property' doesn't exist
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
Caused by: java.sql.SQLSyntaxErrorException: Table 'test4.act_ge_property' doesn't exist
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118)
解决方法:
(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
//activiti的服务
| Service接口 | 作用 |
|---|---|
| RepositoryService | 流程仓库Service,用于管理流程仓库,例如部署、删除、读取流程资源 |
| IdentifyService | 身份Service,用于管理和查询用户、组之间的关系 |
| RuntimeService | 运行时Service,可以也拿过来处理所有正在运行状态的流程实例、任务等 |
| TaskService | 任务Service,用于管理和查询任务,例如签收、办理、指派等 |
| FormService | 表单Service,用于读取流程、任务相关的表单数据 |
| HistoryService | 历史Service,用于查询所有历史数据,例如流程实例、任务、活动、变量、附件 |
| ManagementService | 引擎管理Service,和具体业务无关,主要可以查询引擎配置、数据库、作业等 |
activiti的坑的更多相关文章
- activiti踩坑
最近在学习activiti,偶然间遇到一个错误:加载引擎的时候报错,显示空指针错误,跟代码发现初始化配置文件返回为null.几经排查,可能是因为我发布流程后又清空了数据库数据导致的.然后我把表全部删除 ...
- 流程引擎Activiti系列:在eclipse中搭建咖啡兔的Activiti演示工程中的各种坑及其解决方法(kft-activiti-demo-no-maven)
近期在学习activiti,打算基于现有的框架,比如activiti-explorer或者咖啡兔的示例工程 kft-activiti-demo,在此基础上添加自己的业务流程,看看是否可以走通,以及这个 ...
- activiti 用户手册中 10分钟 小例子 简单代码搭建 及 其中的 各种坑
看mossle的 5.16 用户手册中的 快速起步:10分钟教程 想自己跑一下,虽然官方文档已经写的非常详细了,但是实际操作中还是遇到各种坑,这里记录下来. 首先官网下载最新的 5版本 full G ...
- Activiti之act_ge_property表引发的坑(dbSchemaUpdate)
Activiti之act_ge_property表引发的坑(dbSchemaUpdate) 参考文档: https://blog.csdn.net/lb19921223/article/details ...
- SpringBoot 集成 Activiti 一路踩得坑
由于项目需要,本人开始在项目Spring boot 中集成工作流引擎Activiti.由于第一次集成,一路上步步都是坑,怪我没有先去看官方文档.现将一路上遇到的问题一一记录. 一. 环境配置 1.项目 ...
- 【踩坑】activiti工作流的svg-xml解析报错
1.问题记录 工作流配置画模板的时候保存成功但是部署报错. IE下 activiti工作流解析xml报错 type "path" must be followed by eithe ...
- 爬坑二 activiti流数据库版本错误引发的问题
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actModelCont ...
- Mysql8.0.17版本不能自动创建activiti表的坑
maven项目如下: 配置好数据库,和activiti的配置之后,开始执行流程部署 package com.yuanqiao.first_activiti.deployment; import jav ...
- activiti设置customSessionFactories时的一个小坑
现象:activiti设置customSessionFactories不起作用,流程还是走原来的查询方法原因:新实现的XXXEntityManagerFactory的getSessionType方法返 ...
随机推荐
- 为 32 位单片机设计的脚本语言 Berry
Berry是一款一款为32位单片机设计的脚本语言.Berry解释器使用C89标准实现,该语言可以在RAM或ROM很小的设备上运行. 尽管Berry的体积很小,但是它也支持class以及闭包等功能,使得 ...
- javaWeb上传
上传(上传不能使用BaseServlet) 1. 上传对表单限制 * method="post" * enctype="multipart/form-data&quo ...
- 01 - Element
¶安装 npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm i element-ui -S CDN 目前可以通过 unpkg.com/element- ...
- Oracle 与 postgreSQL 事务处理区别(多版本与undo区别)
2015年左右,因为工作需要用MongoDB.CouchBase这两种文档型数据库,时不时到这两个数据库官网上查资料.报BUG.时常可以在MongoDB官网上看到这样一些新闻,“某某企业成功将MySQ ...
- ueditor粘贴word中图片
最近公司做项目需要实现一个功能,在网页富文本编辑器中实现粘贴Word图文的功能. 我们在网站中使用的Web编辑器比较多,都是根据用户需求来选择的.目前还没有固定哪一个编辑器 有时候用的是UEditor ...
- PHP安装与配置
一.官网下载 进入PHP下载地址http://windows.php.net/download下载最新线程安全版(Thread Safe)PHP zip压缩包,解压缩后放在想要安装的路径下.我这里下载 ...
- git 文件名大小写不敏感
1. 通过修改 git 配置: git config core.ignorecase false 2. 强制执行修改文件名命令: 需要重命名已添加到git的文件时,git mv --f oldFile ...
- BZOJ4406 WC2016 论战捆竹竿
Problem BZOJ Solution 显然是一个同余系最短路问题,转移方案就是所有|S|-border的长度,有 \(O(n)\) 种,暴力跑dijkstra的复杂度为 \(O(n^2\log ...
- 初步学习MySQL
我们之前学习如何安装MySQL数据库 以及 navicat 管理数据库可视化工具 那么现在主要来学习一下如何使用,(操作数据库有很多方式,终端操作.可视化工具操作.编程语句操作) 我们首先学习在终端操 ...
- 10月清北学堂培训 Day 6
今天是黄致焕老师的讲授~ T1 自信 AC 莫名 80 pts???我还是太菜了!! 对于每种颜色求出该颜色的四个边界,之后枚举边界构成的矩阵中每个元素,如果不等于该颜色就标记那种颜色不能最先使用. ...