1. 程式人生 > >springboot集成activiti工作流時容易出現的問題

springboot集成activiti工作流時容易出現的問題

ESS pda 註意 設置 server odin base true lar

No.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;

解決辦法:啟動類上加上 @SpringBootApplication(exclude = SecurityAutoConfiguration.class)即可;因為

activiti-spring-boot-starter-basic中引用了spring-boot-starter-security(具體沒研究)

No.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文件夾;

解決辦法:在resource目錄下添加processes文件夾,並且文件夾不能為空 或是在application.yml文件中加上如下配置(註意是spring節點下)

activiti:
database-schema-update: true
# 自動部署驗證設置:true-開啟(默認)、false-關閉
check-process-definitions: false

No.3

啟動報錯

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘runtimeServiceBean‘ defined in class path resource [com/example/config/ActivitiConfig.class]: Unsatisfied dependency expressed through method ‘runtimeServiceBean‘ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngine‘: FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.

解決辦法:配置數據源時url前加上jdbc-;如:jdbc-url: jdbc:mysql://localhost:3306/activity?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8

springboot集成activiti工作流時容易出現的問題