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,和具体业务无关,主要可以查询引擎配置、数据库、作业等 |
最新文章
- angularjs——插值字符串
- 移动开发流量省起来之Zepto
- 鸟瞰Nodejs
- css权重是什么
- python 输出乱码
- 实现Action类
- 解决insmod: error inserting &#39;hello.ko&#39;: -1 Invalid module format
- javascript基础知识--什么是构造函数?什么是实例化对象?
- Unity3D--学习太空射击游戏制作(四)
- white-space 属性设置如何处理元素内的空白
- C# 部分关键字
- Sql Server存储过程和函数浅谈
- 【JAVAWEB学习笔记】18_el&;jstl&;javaee的开发模式
- Yii2之事件
- Django-rest-framework源码分析----认证
- select样式重置
- powershell脚本执行绕过powershell下脚本执行限制(cmd下执行)以及在cmd下隐藏脚本窗口
- ES6数组的新增功能,还是很强大的好多地方用的到
- scrapy执行流程
- mavean项目的jar位置的影响
热门文章
- Java8新特性--函数式编程
- java技术哪些是必学的?
- 变形和透视 perspective
- [Luogu] 受欢迎的牛
- python ros 四元数转欧拉角
- Hive和Hadoop
- C++的面向对象的Dijkstra写法
- 2018-2019-2 20165222《网络对抗技术》Exp9 Web安全基础
- Cesium Workshop
- Python数据预处理(sklearn.preprocessing)—归一化(MinMaxScaler),标准化(StandardScaler),正则化(Normalizer, normalize)