通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明

前端之家收集整理的这篇文章主要介绍了通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在导入相应包的情况下出现:   通配符的匹配很全面,但无法找到元素 ‘context:component-scan‘ 的声明

可能是xml文档的约束文件有问题,缺少两行

http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-4.2.xsd
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-4.2.xsd"  # 注意版本号
>

猜你在找的XML相关文章