Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'

出现此问题 是spring的jar包与applicationContext.xml中xsd的 版本不同 造成的。

版本不同在联网的情况下不会出现此异常,但当网络断开或者使用内部网络时就会出现此异常。

只需要把applicationContext.xml中的xsd的版本改为与jar包一样的版本即可。

现百度上流行这样一种解决方法,不过这样做我并不能解决问题:

修改Spring applicationContext.xml文件XML的命名空间,改为如下代码:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>

参考路径:http://hi.baidu.com/obullxl/blog/item/734d55fb83da3b62034f56e4.html

猜你喜欢

转载自sundryl6i.iteye.com/blog/1099365