Activiti6使用spring-boot-starter-web遇到requestMappingHandlerMapping错误 [英] Activiti6 use spring-boot-starter-web meet requestMappingHandlerMapping error

查看:141
本文介绍了Activiti6使用spring-boot-starter-web遇到requestMappingHandlerMapping错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:
有些人发现添加( exclude = SecurityAutoConfiguration.class )可以跳过此‍ 错误

Update: Some people found add (exclude = SecurityAutoConfiguration.class) can skip this ‍error :

@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class ActivitiApplication { ... }






我正在使用activiti和spring-boot,
当我将activiti与spring-boot-starter-basic混合使用时,就可以了。
但是,当我在 pom.xml 中添加spring-boot-starter-web时,
i遇到以下错误


I am using activiti and spring-boot, and when i mix activiti with spring-boot-starter-basic it is ok. But when i add spring-boot-starter-web in my pom.xml, i meet the following error :

这是我的代码

https://github.com/cybfly/activiti-demo

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.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.demo.ActivitiApplication.main(ActivitiApplication.java:25) [classes/:na]
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(Unknown Source) ~[na:1.8.0_162]
    at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source) ~[na:1.8.0_162]
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source) ~[na:1.8.0_162]
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(Unknown Source) ~[na:1.8.0_162]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source) ~[na:1.8.0_162]
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.createAnnotationData(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.annotationData(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.createAnnotationData(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.annotationData(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.getAnnotation(Unknown Source) ~[na:1.8.0_162]
    at java.lang.reflect.AnnotatedElement.isAnnotationPresent(Unknown Source) ~[na:1.8.0_162]
    at java.lang.Class.isAnnotationPresent(Unknown Source) ~[na:1.8.0_162]
    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]
    ... 16 common frames omitted




推荐答案

尝试排除Activiti SecurityAutoConfiguration类。

Try excluding the Activiti SecurityAutoConfiguration class.

@SpringBootApplication(exclude = { org.activiti.spring.boot.SecurityAutoConfiguration.class})

这篇关于Activiti6使用spring-boot-starter-web遇到requestMappingHandlerMapping错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆