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的坑的更多相关文章

  1. activiti踩坑

    最近在学习activiti,偶然间遇到一个错误:加载引擎的时候报错,显示空指针错误,跟代码发现初始化配置文件返回为null.几经排查,可能是因为我发布流程后又清空了数据库数据导致的.然后我把表全部删除 ...

  2. 流程引擎Activiti系列:在eclipse中搭建咖啡兔的Activiti演示工程中的各种坑及其解决方法(kft-activiti-demo-no-maven)

    近期在学习activiti,打算基于现有的框架,比如activiti-explorer或者咖啡兔的示例工程 kft-activiti-demo,在此基础上添加自己的业务流程,看看是否可以走通,以及这个 ...

  3. activiti 用户手册中 10分钟 小例子 简单代码搭建 及 其中的 各种坑

    看mossle的 5.16 用户手册中的  快速起步:10分钟教程 想自己跑一下,虽然官方文档已经写的非常详细了,但是实际操作中还是遇到各种坑,这里记录下来. 首先官网下载最新的 5版本 full G ...

  4. Activiti之act_ge_property表引发的坑(dbSchemaUpdate)

    Activiti之act_ge_property表引发的坑(dbSchemaUpdate) 参考文档: https://blog.csdn.net/lb19921223/article/details ...

  5. SpringBoot 集成 Activiti 一路踩得坑

    由于项目需要,本人开始在项目Spring boot 中集成工作流引擎Activiti.由于第一次集成,一路上步步都是坑,怪我没有先去看官方文档.现将一路上遇到的问题一一记录. 一. 环境配置 1.项目 ...

  6. 【踩坑】activiti工作流的svg-xml解析报错

    1.问题记录 工作流配置画模板的时候保存成功但是部署报错. IE下 activiti工作流解析xml报错 type "path" must be followed by eithe ...

  7. 爬坑二 activiti流数据库版本错误引发的问题

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actModelCont ...

  8. Mysql8.0.17版本不能自动创建activiti表的坑

    maven项目如下: 配置好数据库,和activiti的配置之后,开始执行流程部署 package com.yuanqiao.first_activiti.deployment; import jav ...

  9. activiti设置customSessionFactories时的一个小坑

    现象:activiti设置customSessionFactories不起作用,流程还是走原来的查询方法原因:新实现的XXXEntityManagerFactory的getSessionType方法返 ...

随机推荐

  1. P2P system:How Chord tackles failures

    若有peer failures 怎么办 接上面的例子,如果N32 fail掉了,但是N80的finger table还没有更新,这样query到了N16,它找不到N32,只有N80,这样query就会 ...

  2. Javascript基础(1)

    1 Javascript介绍 1.1 js是一款运行在客户端的网页编程语言 1.2 组成部分 (1)ECMAScript:ECMAScript不是一门语言,而是一个标准.符合这个标准的比较常见的有:J ...

  3. springboot项目对接支付宝支付

    支付宝对接文档 一.准备工作 1. 首先要到 蚂蚁金服开发者中心 https://openhome.alipay.com/platform/home.htm 注册商家账户,并认证. 2.下载java版 ...

  4. python中的_xx, __xx, __xx__

    一.从模块分析 ########  bb.py (一个用来导入的模块) ########## var = 0_var = 1__var = 2__var__ = 3 1. from module im ...

  5. python - redis 的使用

    1.redis连接 redis提供两个类Redis和StrictRedis用于实现Redis的命令,StrictRedis用于实现大部分官方的命令,并使用官方的语法和命令,Redis是StrictRe ...

  6. 怎能使用echo 输出对象

     class A{         function __toString() {             return "怎么使用echo输出对象";          }   ...

  7. Html5第一章

    赵冬梅 一.HTML简介 Hyper Text Markup Language(超文本标记语言) 超文本包括:文字.图片.音频.视频.动画等 二.HTML发展史 1993-6发布超文本标记语言 ... ...

  8. java后台防止XSS的脚本攻击

    import java.util.regex.Pattern; //具体过滤关键字符public class XSSUtil { private static Pattern[] patterns = ...

  9. 动态menu导航条以及treeview树

    1.menu表数据 2.在后台生成html内容后,前台利用nav-h.css生成menu导航条,利用Jquery的treeview插件生成menu树 前台coding: <!DOCTYPE ht ...

  10. mac apache 管理

    sudo apachectl start sudo apachectl stop sudo apachectl restart