Spring Exception: cvc-elt.1: Cannot find the declaration of element 'beans'

Spring Exception: cvc-elt.1: Cannot find the declaration of element 'beans'

引起的原因是服务器不能成功从Spring官网加载xsd文件。

方案一:

将Spring从官网加载spring-beans-2.5.xsd改为从本地classpath中加载:

xsi:schemaLocation="http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"

改为:

xsi:schemaLocation="http://www.springframework.org/schema/beans        
       classpath:/org/springframework/beans/factory/xml/spring-beans-2.0.xsd"

方案二(推荐):

从Spring Jar包中spring-framework-2.5.6\src\META-INF下面拷贝spring.handlers,spring.schemas到web项目里的src\main\webapp\META-INF下

猜你喜欢

转载自jerval.iteye.com/blog/2357722