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

转载于:https://www.cnblogs.com/shanshen/p/9054173.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值