这个报错一般都是由于依赖有重复包了,根据maven或gradle排查下包结构看有没有重复的,下面是我的排查思路
在使用easypoi时遇到了这个问题:
Error creating bean with name ‘requestMappingHandlerMapping’ defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Invocation of init method failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy,我是引入了这个整合springboot的包
在这里插入图片描述
但这里发现这两个依赖里都有spring-boot这个包导致了包重复,这就是报错的原因
在这里插入图片描述

解决办法:

1.使用这个官方提供的这三个单独依赖而不使用跟springboot整合后的依赖
在这里插入图片描述
2.使用exclude把重复依赖给排除

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐