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,和具体业务无关,主要可以查询引擎配置、数据库、作业等

最新文章

  1. angularjs——插值字符串
  2. 移动开发流量省起来之Zepto
  3. 鸟瞰Nodejs
  4. css权重是什么
  5. python 输出乱码
  6. 实现Action类
  7. 解决insmod: error inserting &#39;hello.ko&#39;: -1 Invalid module format
  8. javascript基础知识--什么是构造函数?什么是实例化对象?
  9. Unity3D--学习太空射击游戏制作(四)
  10. white-space 属性设置如何处理元素内的空白
  11. C# 部分关键字
  12. Sql Server存储过程和函数浅谈
  13. 【JAVAWEB学习笔记】18_el&amp;jstl&amp;javaee的开发模式
  14. Yii2之事件
  15. Django-rest-framework源码分析----认证
  16. select样式重置
  17. powershell脚本执行绕过powershell下脚本执行限制(cmd下执行)以及在cmd下隐藏脚本窗口
  18. ES6数组的新增功能,还是很强大的好多地方用的到
  19. scrapy执行流程
  20. mavean项目的jar位置的影响

热门文章

  1. Java8新特性--函数式编程
  2. java技术哪些是必学的?
  3. 变形和透视 perspective
  4. [Luogu] 受欢迎的牛
  5. python ros 四元数转欧拉角
  6. Hive和Hadoop
  7. C++的面向对象的Dijkstra写法
  8. 2018-2019-2 20165222《网络对抗技术》Exp9 Web安全基础
  9. Cesium Workshop
  10. Python数据预处理(sklearn.preprocessing)—归一化(MinMaxScaler),标准化(StandardScaler),正则化(Normalizer, normalize)