Recently, because the project needs to integrate the activity workflow, the boss gave me this glorious and arduous task. I have never touched the workflow before, knowing that an activity is a workflow, and I don’t know anything else, cough, nonsense. After talking more, I started to step on the pit.
The first step: of
course, the package is introduced first, and now there is 6.0.0, but to be on the safe side, don’t use the latest one.
<activiti.version>5.22.0</activiti.version>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-basic</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-diagram-rest</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-rest</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>${activiti.version}</version>
</dependency>
Step 2:
Configure activity parameters in application.yml
spring:
activiti:
history-level: full
check-process-definitions: false
database-schema-update: true
The third step:
Run the project, and the result is not unexpected.
Failed to process import candidates for configuration class [frame.Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class]
Add package after Baidu
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>、
</dependency>
but. . . . . .
Another error occurred. . .
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
No way,
after some
troubles with Baidu , the startup class was changed to @SpringBootApplication(exclude ={org.activiti.spring.boot.SecurityAutoConfiguration.class}) to
start successfully.
The matter is not over yet, open the login page, Nani, turned into a security authentication
login page
The authentication page
continued to toss and found that the start of spring 2.0 also quoted a SecurityAutoConfiguration, so this security authentication should also be excluded.
@SpringBootApplication(exclude ={org.activiti.spring.boot.SecurityAutoConfiguration.class,org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class})
Run again, success.