creating bean with name ‘requestMappingHandlerMapping‘ defined in class path resource(已解决)

报错原因:
Activiti6.0和SpringBoot2.x的兼容性问题

报错内容

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/D:/JAVA/apache-maven-3.6.2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is 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

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

  1. url路径问题,查看你的@RequestMapping是否相同,指定具体方式GET/POST,路径是否多/

  2. 插件和SpringBoot版本不兼容问题,我的SpringBoot2.x 引用了Activiti 6.0的版本在启动类排除冲突,@SpringBootApplication( exclude = SecurityAutoConfiguration.class)
    如果你并没有将流程控制文件xx.bpmn加入项目也会报错,所以我们在配置文件里面暂时不检查它,后续可能会更新通过配置文件如何管理控制activiti

spring.activiti.database-schema-update=true
#自动部署验证设计,生成表
spring.activiti.check-process-definitions=false
#解决activiti一直调用sql查询问题
spring.activiti.async-executor-activate=false

我这里是引用的公告类,由于用不到acitiviti我就直接把相关依赖删除了
文章参考了https://www.jianshu.com/p/9b1dbb2c85e7
感谢大佬的文章

正在学习中,如有不足之处,感谢大家评论指正

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defines in class path resource \[org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvConfiguration.class\]: 。 引用\[2\]:Error creating bean with name ‘requestMappingHandlerMappingdefined in class path resource \[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class\]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘crmNicheController’ method 启动报错解决记录 。 引用\[3\]:那么如果是这种问题在运行了项目之后报错了怎么解决呢,出现这种的错误代码,我们首先应该根据23体验网上面提到的,检查一下pom.xml文件中有没有这个maven包被引入: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> <version>1.5.4.RELEASE</version> </dependency> 。 问题:rror creating bean with name 'requestMappingHandlerMapping' defined in class path resource 回答: 这个错误通常是由于Spring框架的配置问题引起的。根据引用\[1\]和引用\[2\]的描述,这个错误可能是由于RequestMappingHandlerMapping的定义或初始化方法失败导致的。可能的原因是映射冲突或依赖包未正确引入。根据引用\[3\]的建议,你可以检查你的pom.xml文件中是否引入了正确的maven包,并确保版本号与你的项目兼容。另外,你还可以检查RequestMappingHandlerMapping的配置是否正确,避免映射冲突。如果问题仍然存在,你可以进一步查看错误日志以获取更多详细信息,并根据具体情况采取相应的解决措施。 #### 引用[.reference_title] - *1* *3* [异常:Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource的...](https://blog.csdn.net/weixin_44259720/article/details/103144694)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Error creating bean with name ‘requestMappingHandlerMappingdefined in class path resource报错](https://blog.csdn.net/qq_40775389/article/details/123846278)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值