org.xml.sax.SAXParseException: Failed to read schema document 的原因分析与解决方法
来源:互联网 发布:3344ff新域名 编辑:程序博客网 时间:2024/06/10 22:50
现象:
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema documen
t 'http://www.springframework.org/schema/beans/spring-beans-3.1.xsd', because 1)
could not find the document; 2) the document could not be read; 3) the root ele
ment of the document is not <xsd:schema>.
分析:
参考http://blog.csdn.net/bluishglc/article/details/7596118
这篇文章分析的比较深入,具体原因为:
根据xx.jar\META-INF\spring.schemas文件,先在本地查找相关xsd文件,如果本地没有,则通过网络去获取,实际上上面问题往往出现在没有网络的服务器上(本地正常,传到服务器上,而服务器一般是不能访问外网的)
但该文章并没有讲清楚更具体的处理措施,只是说了最好用maven的shade打包插件而不是assembly
处理:
必须在 <transformers> 里面加上下面内容
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
才会出现“shade能够将所有jar里的spring.schemas文件进行合并,在最终生成的单一jar包里,spring.schemas包含了所有出现过的版本的集合!”的效果
参考
http://blog.csdn.net/bluishglc/article/details/7596118
http://mapserver000-gmail-com.iteye.com/blog/1182499
http://shuhucy.iteye.com/blog/1771684
http://stackoverflow.com/questions/8523997/unable-to-locate-spring-namespacehandler-for-xml-schema-namespace-http-www-sp/8574629#8574629
http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html
http://maven.apache.org/plugins/maven-shade-plugin/
- org.xml.sax.SAXParseException: Failed to read schema document 的原因分析与解决方法
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- org.xml.sax.SAXParseException: Failed to read schema document错误的完美解决方法 以及 Spring如何加载XSD文件
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- ubuntu 开机出现“ the disk drive for /media/XXXX is not ready yet or not present“解决
- hdu 1525 博弈
- SPprocthreadpool 线程池源码阅读
- 递归探究
- hdu(2266)深搜
- org.xml.sax.SAXParseException: Failed to read schema document 的原因分析与解决方法
- Shortest Prefixes(poj2001,tire树)
- 成员函数 回调函数
- 老码农教你学英语
- 安卓应用桌面小图标
- 每个上班的人都应该懂劳动法
- 账户管理命令 useradd、groupadd
- HDU 4671 Backup Plan
- hdu 2686最小费用最大流问题