Activiti7各种的坑

数据库连接的问题

不创建表的问题,一运行就发现
org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table ‘activiti_leave_process.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 ‘activiti_leave_process.act_ge_property’ doesn’t exist

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.0.jar:3.5.0]

Activiti7各种的坑_第1张图片

解决方案

1 修改MySQL数据库驱动的版本


<dependency>
    <groupId>mysqlgroupId>
    <artifactId>mysql-connector-javaartifactId>
    <version>5.1.48version>
    <scope>runtimescope>
dependency>

2单独创建一个数据库连接类

package com.dowhere.utils;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.sql.DataSource;

/**
 *  数据库配置类
 */
@Configuration
public class DataSourceConfig {

    @Autowired
    private Environment env;

    @Bean
    public DataSource getDataSource() {
        DruidDataSource dataSource = new DruidDataSource();


        dataSource.setDriverClassName(env.getProperty("spring.datasource.driverClassName"));
        dataSource.setUrl(env.getProperty("spring.datasource.url"));
        dataSource.setUsername(env.getProperty("spring.datasource.username"));
        dataSource.setPassword(env.getProperty("spring.datasource.password"));

        System.out.println(env.getProperty("spring.datasource.url"));

        return dataSource;
    }
}


org.activiti.engine.ActivitiException: Errors while parsing:

[Validation set: ‘activiti-executable-process’ | Problem: ‘activiti-process-definition-not-executable’] : All process definition are set to be non-executable (property ‘isExecutable’ on process). This is not allowed. - [Extra info : ]

出现这个错误是bpmn文件设置的问题,认真的检查一下文件,看看有没有多空格或符号什么的。

启动提示Activiti版本的问题

检查数据库的表,进行修改,要保证数据的值与你导入的activiti的包一致
Activiti7各种的坑_第2张图片

你可能感兴趣的:(java)