The prefix "context" for element "context:component-scan" is not bound.
2015-01-16 16:29
441 查看
配置spring,配置
<context:component-scan base-package="包名" />
时,报错:
The prefix "context" for element "context:component-scan" is not bound.
是因为该配置文件的<beans></beans>标签的属性少了东西。<beans>加上相应属性即可。如下图(红线上那一列即为需要加上的东西):
![](https://oscdn.geek-share.com/Uploads/Images/Content/202010/17/900430742b75ccb16674f386be5383b1)
下面是需要添加的部分的文字版:
xmlns:context="http://www.springframework.org/schema/context"
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
<context:component-scan base-package="包名" />
时,报错:
The prefix "context" for element "context:component-scan" is not bound.
是因为该配置文件的<beans></beans>标签的属性少了东西。<beans>加上相应属性即可。如下图(红线上那一列即为需要加上的东西):
下面是需要添加的部分的文字版:
xmlns:context="http://www.springframework.org/schema/context"
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
相关文章推荐
- The prefix "context" for element "context:component-scan" is not bound.
- Dubbo之 The prefix "context" for element "context:component-scan" is not bound
- The prefix "context" for element "context:component-scan" is not bound.
- org.xml.sax.SAXParseException: The prefix "context" for element "context:component-scan" is not boun
- 报错:The prefix "context" for element "context:annotation-config" is not bound.
- 错误提示:The prefix "aop" for element "aop:config" is not bound.
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- The prefix "tx" for element "tx:annotation-driven " is not bound
- Flex新建组件中添加Style的错误:The prefix "mx" for element "mx:Script" is not bound
- the prefix "tx" for element "tx:annotation-driven" is not bound
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- 错误提示:The prefix "aop" for element "aop:config" is not bound.
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "tx" for element "tx:annotation-driven" is not bound.
- The prefix "tx" for element "tx:advice" is not bound 错误的说明
- The prefix "aop" for element "aop:aspectj-autoproxy" is not bound.
- The prefix "tx" for element "tx:annotation-driven " is not bound
- 【转】The prefix "tx" for element "tx:advice" is not bound 错误的说明