通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明。--问题的原因及解决方案
2017-02-23 16:35
956 查看
在搭建Spring框架时,在applicationContext.xml文件中写自动扫描的配置时,报出异常。
原因:<beans>标签的文件头未写完整,特别是xsd文件。
给出一个范例:<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 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"> <context:component-scan base-package="com.yykj.soundsystem"/>
原因:<beans>标签的文件头未写完整,特别是xsd文件。
给出一个范例:<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 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"> <context:component-scan base-package="com.yykj.soundsystem"/>
相关文章推荐
- 关于spring”通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明“的错误
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明。
- SpringMVC 出现通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明。
- 关于spring”通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明“的错误
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明。
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明
- 关于spring”通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明“的错误
- spring 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明
- 关于spring”通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明“的错误
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan' 的声明。
- 通配符的匹配很全面, 但无法找到元素 'context:component-scan'
- 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明
- cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明
- spring报错:通配符的匹配很全面, 但无法找到元素 'context:annotation-config' 的声明
- 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明
- Caused by: org.xml.sax.SAXParseException; 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明。
- "通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven' 的声明" 的解决方案
- 通配符的匹配很全面, 但无法找到元素mvc:default-servlet-handler声明 解决方案
- cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'context:property-placeholder' 的声明