1. org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
原因:SpringBoot 2.0的start中默认有一个"spring-boot-autoconfigure-2.0..RELEASE.jar",如果你还引用了activiti的"activiti-spring-boot-starter-rest-api.jar"包,需要将两个包中的 SecurityAutoConfiguration.class 其中之一排除。我选择禁用activiti安全策略。
解决方案:
2.Parameter 0 of method springAsyncExecutor in org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration required a single bean, but 4 were found
原因:Activiti自动配置类中的错误。它依赖于它们TaskExecutor在应用程序上下文中唯一的一个bean,或者如果有多个bean,则它们中的一个是主要的。可以通过声明自己的TaskExecutorbean并将其标记为@Primary:解决该问题。
解决方案:在项目的Application启动类中添加以下代码即可。
@Primary
@Bean
public TaskExecutor primaryTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
return executor;
}
3.nested exception is java.io.FileNotFoundException: class path resource [processes/] cannot be resolved to URL because it does not exist
解决方案:
(1)在resource目录下添加processes文件夹
(2)在application.properties下配置
#启动报错class path resource [processes/] cannot be resolved to URL because it does not exist
spring.activiti.check-process-definitions=false
4.启动时没有创建表:
解决方案:
(1)检查yml文件中是否有如下配置:
spring:
activiti:
database-schema-update: true
(2)修改数据库连接配置: 加上【nullCatalogMeansCurrent=true
】
在使用mysql-connect 8.+以上版本的时候需要添加nullCatalogMeansCurrent=true
参数,否则在使用mybatis-generator生成表对应的xml等时会扫描整个服务器里面的全部数据库中的表,而不是扫描对应数据库的表。
dynamic:
datasource:
slave1:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.4:3308/database?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true