Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the pit that spring boot2 integrated activiti6 stepped on

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to solve the pit of spring boot2 integration activiti6, which is very detailed and has certain reference value. Friends who are interested must read it!

Mybaitis version conflict error message in 1.activiti

Caused by: java.lang.NoSuchFieldError: INSTANCE

At com.baomidou.mybatisplus.MybatisMapperAnnotationBuilder.parseStatement (MybatisMapperAnnotationBuilder.java:332) ~ [mybatis-plus-core-2.3.jar:?]

At com.baomidou.mybatisplus.MybatisMapperAnnotationBuilder.parse (MybatisMapperAnnotationBuilder.java:153) ~ [mybatis-plus-core-2.3.jar:?]

At com.baomidou.mybatisplus.MybatisMapperRegistry.addMapper (MybatisMapperRegistry.java:86) ~ [mybatis-plus-core-2.3.jar:?]

At com.baomidou.mybatisplus.MybatisConfiguration.addMapper (MybatisConfiguration.java:101) ~ [mybatis-plus-core-2.3.jar:?]

At org.apache.ibatis.builder.xml.XMLMapperBuilder.bindMapperForNamespace (XMLMapperBuilder.java:408) ~ [mybatis-3.4.2.jar:3.4.2]

At org.apache.ibatis.builder.xml.XMLMapperBuilder.parse (XMLMapperBuilder.java:94) ~ [mybatis-3.4.2.jar:3.4.2]

At com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.buildSqlSessionFactory (MybatisSqlSessionFactoryBean.java:583) ~ [mybatis-plus-core-2.3.jar:?]

After investigation, it is because I use mybatis plus and ask to use mybatis3.4.6, while activiti uses mybatis3.4.2. There is a conflict between the two sides, so just rule out activitiv:

SecurityAutoConfiguration conflict startup project in org.activiti activiti-spring-boot-starter-basic 6.0.0 org.mybatis mybatis 2.activiti

Report a mistake as follows

Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

At sun.reflect.annotation.AnnotationParser.parseClassArray (AnnotationParser.java:724) ~ [?: 1.8.0,181]

At sun.reflect.annotation.AnnotationParser.parseArray (AnnotationParser.java:531) ~ [?: 1.8.0,181]

At sun.reflect.annotation.AnnotationParser.parseMemberValue (AnnotationParser.java:355) ~ [?: 1.8.0,181]

At sun.reflect.annotation.AnnotationParser.parseAnnotation2 (AnnotationParser.java:286) ~ [?: 1.8.0,181]

At sun.reflect.annotation.AnnotationParser.parseAnnotations2 (AnnotationParser.java:120) ~ [?: 1.8.0,181]

At sun.reflect.annotation.AnnotationParser.parseAnnotations (AnnotationParser.java:72) ~ [?: 1.8.0,181]

At java.lang.Class.createAnnotationData (Class.java:3521) ~ [?: 1.8.0,181]

At java.lang.Class.annotationData (Class.java:3510) ~ [?: 1.8.0,181]

At java.lang.Class.createAnnotationData (Class.java:3526) ~ [?: 1.8.0,181]

At java.lang.Class.annotationData (Class.java:3510) ~ [?: 1.8.0,181]

At java.lang.Class.getAnnotation (Class.java:3415) ~ [?: 1.8.0,181]

It is found that there is a conflict in the class SecurityAutoConfiguration, so you can exclude the class at startup.

@ Slf4j@EnableSwagger2@SpringBootApplication (exclude = {SecurityAutoConfiguration.class}) / / @ EnableAutoConfiguration this needs to be commented out or the exclusion operation above is invalid public class JeecgApplication {public static void main (String [] args) throws UnknownHostException {check-process-definitions problem of automatic search for process files in 3.activiti

The following error is made in the project startup times

Check-process-definitions problem of automatically searching process files in activiti

The following error is made in the project startup times

Caused by: java.io.FileNotFoundException: class path resource [processes/] cannot be resolved to URL because it does not exist

At org.springframework.core.io.ClassPathResource.getURL (ClassPathResource.java:195) ~ [spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE]

At org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources (PathMatchingResourceP

It means to look for the process file in the directory processes/, which just needs to be configured with check-process-definitions

Spring: activiti: database-schema-update: true check-process-definitions: falsespringboot2 Integration activiti6 problem Collection 1. Failure caused by reflection analysis of the annotation metadata of a class file

Org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1708) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:581) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:503) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:317) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:315) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:760) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:869) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.__refresh (AbstractApplicationContext.java:550) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh (AbstractApplicationContext.java:40002) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:41008) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh (ServletWebServerApplicationContext.java:140) ~ [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.refresh (SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At com.example.activititest.ActivitiTestApplication.main (ActivitiTestApplication.java:13) [classes/:na]

Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

At sun.reflect.annotation.AnnotationParser.parseClassArray (AnnotationParser.java:724) ~ [na:1.8.0_161]

At sun.reflect.annotation.AnnotationParser.parseArray (AnnotationParser.java:531) ~ [na:1.8.0_161]

At sun.reflect.annotation.AnnotationParser.parseMemberValue (AnnotationParser.java:355) ~ [na:1.8.0_161]

At sun.reflect.annotation.AnnotationParser.parseAnnotation2 (AnnotationParser.java:286) ~ [na:1.8.0_161]

At sun.reflect.annotation.AnnotationParser.parseAnnotations2 (AnnotationParser.java:120) ~ [na:1.8.0_161]

At sun.reflect.annotation.AnnotationParser.parseAnnotations (AnnotationParser.java:72) ~ [na:1.8.0_161]

At java.lang.Class.createAnnotationData (Class.java:3521) ~ [na:1.8.0_161]

At java.lang.Class.annotationData (Class.java:3510) ~ [na:1.8.0_161]

At java.lang.Class.createAnnotationData (Class.java:3526) ~ [na:1.8.0_161]

At java.lang.Class.annotationData (Class.java:3510) ~ [na:1.8.0_161]

At java.lang.Class.getAnnotation (Class.java:3415) ~ [na:1.8.0_161]

At java.lang.reflect.AnnotatedElement.isAnnotationPresent (AnnotatedElement.java:258) ~ [na:1.8.0_161]

At java.lang.Class.isAnnotationPresent (Class.java:3425) ~ [na:1.8.0_161]

At org.springframework.core.annotation.AnnotatedElementUtils.hasAnnotation (AnnotatedElementUtils.java:573) ~ [spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.isHandler (RequestMappingHandlerMapping.java:177) ~ [spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods (AbstractHandlerMethodMapping.java:217) ~ [spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet (AbstractHandlerMethodMapping.java:188) ~ [spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet (RequestMappingHandlerMapping.java:129) ~ [spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1767) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1704) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

... 18 common frames omitted

Solution: add (exclude = SecurityAutoConfiguration.class) to the startup class to remove SecurityAutoConfiguration

@ SpringBootApplication (exclude = SecurityAutoConfiguration.class) @ MapperScan (basePackages = "com.example.test.dao") public class ActivitiTestApplication {public static void main (String [] args) {SpringApplication.run (ActivitiTestApplication.class, args);}} 2.activiti default automatic deployment verification setting problem

Org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springProcessEngineConfiguration' defined in class path resource [org/activiti/spring/boot/DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration.class]: 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

At org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod (ConstructorResolver.java:590) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod (AbstractAutowireCapableBeanFactory.java:1256) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1105) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:543) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:503) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:317) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:315) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:760) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:869) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.__refresh (AbstractApplicationContext.java:550) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh (AbstractApplicationContext.java:40002) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:41008) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh (ServletWebServerApplicationContext.java:140) ~ [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.refresh (SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.boot.SpringApplication.run (SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At com.example.activititest.ActivitiTestApplication.main (ActivitiTestApplication.java:13) [classes/:na]

Caused by: 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

At org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate (SimpleInstantiationStrategy.java:185) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod (ConstructorResolver.java:582) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

... 20 common frames omitted

Caused by: java.io.FileNotFoundException: class path resource [processes/] cannot be resolved to URL because it does not exist

At org.springframework.core.io.ClassPathResource.getURL (ClassPathResource.java:195) ~ [spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources (PathMatchingResourcePatternResolver.java:495) ~ [spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources (PathMatchingResourcePatternResolver.java:296) ~ [spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.boot.devtools.restart.ClassLoaderFilesResourcePatternResolver.getResources (ClassLoaderFilesResourcePatternResolver.java:115) ~ [spring-boot-devtools-2.0.3.RELEASE.jar:2.0.3.RELEASE]

At org.springframework.context.support.GenericApplicationContext.getResources (GenericApplicationContext.java:231) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.activiti.spring.boot.AbstractProcessEngineConfiguration.discoverProcessDefinitionResources (AbstractProcessEngineConfiguration.java:79) ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration.baseSpringProcessEngineConfiguration (AbstractProcessEngineAutoConfiguration.java:74) ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At org.activiti.spring.boot.DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration.springProcessEngineConfiguration (DataSourceProcessEngineAutoConfiguration.java:57) ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At org.activiti.spring.boot.DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration$$EnhancerBySpringCGLIB$$7a8e3743.CGLIB$springProcessEngineConfiguration$1 () ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At org.activiti.spring.boot.DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration$$EnhancerBySpringCGLIB$$7a8e3743 $$FastClassBySpringCGLIB$$161a3fa0.invoke () ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At org.springframework.cglib.proxy.MethodProxy.invokeSuper (MethodProxy.java:228) ~ [spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept (ConfigurationClassEnhancer.java:361) ~ [spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]

At org.activiti.spring.boot.DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration$$EnhancerBySpringCGLIB$$7a8e3743.springProcessEngineConfiguration () ~ [activiti-spring-boot-starter-basic-6.0.0.jar:na]

At sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethod) ~ [na:1.8.0_161]

At sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) ~ [na:1.8.0_161]

At sun.reflect.DelegatingMethodAccessorImpl.__invoke (DelegatingMethodAccessorImpl.java:43) ~ [na:1.8.0_161]

At sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:45009) ~ [na:1.8.0_161]

At sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:45012) ~ [na:1.8.0_161]

At java.lang.reflect.Method.invoke (Method.java:498) ~ [na:1.8.0_161]

At org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate (SimpleInstantiationStrategy.java:154) ~ [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

... 21 common frames omitted

Solution: in the application.properties file, change the default automatic deployment verification setting to false

Spring.activiti.check-process-definitions=false3.mysql introduction package is too high

# 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_ =?

Solution: modify the mysql-connector-java version

Mysql mysql-connector-java 5.1.43 and above are all the contents of this article entitled "how to solve the pitfalls of spring boot2 Integration activiti6". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report