您的位置:首页 > 编程语言 > Java开发

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

2018-01-22 17:35 671 查看
这一点有些奇怪,我的开发环境是Spring 4.3.2.Release版本,关于context的xml的约束位置的声明,要指定清楚,才能避免标题中提及的错误。

而其他的xsi:schemaLocation,比如jdbc等就不需要,默认就是当前版本,正确的。

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">[/code] 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Spring context
相关文章推荐