Spring配置文件出错:找不到元素 'beans' 的声明。
ddxu 2015-08-27 02:30:58 我的配置文件xml是这样写的
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schame/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean class="com.spring.chapter04.definition.HelloWorldImpl"></bean>
<bean id="helloWorld" class="com.spring.chapter04.definition.HelloWorldImpl"></bean>
<bean name="helloWorldByName" class="com.spring.chapter04.definition.HelloWorldImpl"></bean>
<bean id="helloWorldById" name="helloWorldByName01" class="com.spring.chapter04.definition.HelloWorldImpl"></bean>
</beans>
错误如下:
Caused by: org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 70; cvc-elt.1: 找不到元素 'beans' 的声明。
最神奇的是我无论怎么改都是第7行,我在前面添加行,它还是报第7行!