spring xml配置报错Cannot locate BeanDefinitionParser for element [componet-scan]

zylzl123 2015-08-01 09:31:41
<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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">


<!-- 1.注解注入 -->
<context:annotation-config/>
<context:componet-scan base-package="com.practice"/>
<!-- 在上句一直报错Multiple annotations found at this line:
- Configuration problem: Cannot locate
BeanDefinitionParser for element [componet-scan]
Offending resource: file [E:/workspace/SpringPractice1/src/
main/resources/springconfig.xml]
- Cannot locate BeanDefinitionParser for element
[componet-scan] -->

<!--2. 属性注入和构造函数注入-->
<bean id="car1" class="com.practice.Car">
<property name="brand"><value>"红旗"</value></property>
<property name="color"><value>"黑色"</value></property>
</bean>
</beans>
...全文
643 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
迷林 2015-08-04
  • 打赏
  • 举报
回复
写错了吧
Java尖子生 2015-08-03
  • 打赏
  • 举报
回复
component-scan 拼写错误

50,503

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧