
你的配置很好,除了一个地方
@ComponentScan(basePackages = {“ org.example.springproject”})
我假设你的包中还有其他@Configuration,由@ComponentScan拾取(出现在异常中的DelegatingWebMvcConfiguration很可能是由@EnableWebMvc在外部@Configuration中的某个位置导入的)。
可能的解决方案是在组件扫描中使用过滤器。
@ComponentScan(basePackages = {“ org.example.springproject”},excludeFilters = {@Filter(type = FilterType.ANNOTATION,value = Configuration.class)})
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)