Reprinted from http://blog.csdn.net/legendj/article/details/9950963
Today, when writing the spring AOP example, a red fork appears after adding the spring AOP schema in the Spring.xml file, and the spring configuration file is as follows:
<?XML version= "1.0" encoding= "UTF-8"?> <Beansxmlns= "Http://www.springframework.org/schema/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"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-contex T-3.0.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP Http://www.springframework.org/schema/aop/spring-aop-3.0.xs D "> </Beans>
Hint says: Cvc-elt.1:cannot find the declaration of element ' Beans ',
Search from the Internet, some say because the network is not access to the XSD file, because access to the XSD file on the network, we can access the local Ah, in the introduction of the spring package There are spring-beans-3.0.xsd files in the Spring-beans-3.2.2.release.jar, and the other XSD files can be found in the corresponding packages, so it's all right to change the XSD file references to local files:
<?XML version= "1.0" encoding= "UTF-8"?> <Beansxmlns= "Http://www.springframework.org/schema/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"xsi:schemalocation= "Http://www.springframework.org/schema/beans Classpath:/org/springframework/beans/factory/xml/spring-bean S-3.0.xsd Http://www.springframework.org/schema/context classpath:/org/springframework/context/config/spring-c Ontext-3.0.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP classpath:/org/springframework/aop/config/spring-aop-3 .0.xsd "> </Beans>
OK Error resolution
Spring Cvc-elt.1:cannot Find the declaration of element ' beans ' solution