配置xml文件时,错误显示:
“cvc-complex-type.2.4.c: matching wildcard is strict, but no declaration can be found for element ‘context:component-scan’.”
原因是缺少:
xmlns:context="http://www.springframework.org/schema/context"
一般报这种错是缺少命名空间配置,具体查找方式:
以spring-aop-4.3.3.RELEASE.jar为例
找到MET-INF这个文件夹
Spring.handlers
http\://www.springframework.org/schema/aop=org.springframework.aop.config.Ao

当遇到“cvc-complex-type.2.4.c: matching wildcard is strict, but no declaration can be found for element ‘context:component-scan’”的错误时,通常是由于缺少命名空间配置。Spring通过EntityResolver查找本地的spring.schemas文件映射XSD。如果XSD URL带有不匹配的版本号,Spring将尝试从公网加载,导致失败。解决方案包括避免在XML中指定版本号或自建服务器托管XSD文件。"
50354148,4752125,Android FragmentArguments实践:列表详情同步,"['Android开发', 'Fragment', '设计模式']
最低0.47元/天 解锁文章

411

被折叠的 条评论
为什么被折叠?



