【发布时间】:2013-09-19 03:00:16
【问题描述】:
在春天,每当我在 spring.xml 中写 <context:annotation-config/> 时,我都会收到此错误:-
线程“main”中的异常 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自类路径资源 [spring.xml] 的 XML 文档中的第 81 行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:81;列号:30; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素'context:annotation-config'的声明。
而我spring.xml的内容是
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"
xmlns:context="http://www.springframework.org/schema/context"
>
<bean id="circle" class="com.mysite.Circle">
</bean>
...
<context:annotation-config/>
谁能告诉我哪里出错了????
【问题讨论】:
标签: xml spring spring-mvc