1、启动报错
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.activiti.spring.boot.SecurityAutoConfiguration':
Initialization of bean failed; nested exception is java.lang.ArrayStoreException:
sun.reflect.annotation.TypeNotPresentExceptionProxy;
(1)解决办法:启动类上加上@SpringBootApplication(exclude = SecurityAutoConfiguration.class)即可;
(2)原因:activiti-spring-boot-starter-basic中引用了spring-boot-starter-security。
2、启动报错
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'springProcessEngineConfiguration' defined in class path resource
[xxxxx/xxxx/xxx.java]: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.activiti.spring.SpringProcessEngineConfiguration]:
Factory method 'springProcessEngineConfiguration' threw exception;
nested exception is java.io.FileNotFoundException:
class path resource [processes/] cannot be resolved to URL because it does not exist;
解决办法:在resource目录下添加processes文件夹,并且文件夹不能为空或是在配置文件中加上如下配置
(1)application.yml文件
spring:
activiti:
database-schema-update: true
#自动部署验证设置:true-开启(默认)、false-关闭
check-process-definitions: false;
(2)application.properties文件
spring.activiti.database-schema-update=true
spring.activiti.check-process-definitions=false
3、启动报错
Caused by: java.sql.SQLSyntaxErrorException: Table 'activiti.act_ge_property' doesn't exist
(1)解决办法:yml或properties配置文件中,配置mysql连接时加上:nullCatalogMeansCurrent=true
(2)原因:mysql版本问题,mysql 8.xx以上驱动会出现这个问题,因为mysql使用schema标识库名而不是catalog,因此mysql
会扫描所有的库来找表,如果其他库中有相同名称的表,activiti就以为找到了,本质上这个表在当前数据库中并不存在。设置
nullCatalogMeansCurrent=true,表示mysql默认当前数据库操作,在mysql-connector-java 5.xx该参数默认为true,在6.xxx以上
默认为false,因此需要设置nullCatalogMeansCurrent=true。
文章参考一篇博客,具体记不清了。