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