xml文件的xsd验证失败信息
Referenced file contains errors http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
最近一个java web工程中常出现xml文件的xsd验证失败信息,异常如下:
Multiple annotations found at this line:- Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd). For more information, right click on the message in the Problems View and select "Show Details..."- Referenced file contains errors (http://www.springframework.org/schema/tool/spring-tool-3.0.xsd). For more information, right click on the message in the Problems View and select "Show Details..."- Referenced file contains errors (http://www.springframework.org/schema/context/spring-context-3.0.xsd). For more information, right click on the message in the Problems View and select "Show Details..."
展开异常信息:
The errors below were detected when validating the file "spring-beans-3.0.xsd" via the file "applicationContext-mongodb.xml". In most cases these errors can be detected by validating "spring-beans-3.0.xsd" directly. However it is possible that errors will only occur when spring-beans-3.0.xsd is validated in the context of applicationContext-mongodb.xml.
解决办法就是将配置文件中的xsd文件的版本号去掉。
原文档:
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"xmlns:mongo="http://www.springframework.org/schema/data/mongo"xsi:schemaLocation="http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsdhttp://www.springframework.org/schema/data/mongohttp://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsdhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
修改为:
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"xmlns:mongo="http://www.springframework.org/schema/data/mongo"xsi:schemaLocation="http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/data/mongohttp://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsdhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
就是将spring-context的xsd文件的版本号去了就可以了。
参考:http://stackoverflow.com/questions/13693065/error-in-spring-application-context-schema
xml文件的xsd验证失败信息相关推荐
- 根据xml 文件生成 xsd文件 以及相关测试方法
1.下载trang.jar 下载地址: http://www.java2s.com/Code/Jar/t/Downloadtrang20091111jar.htm 2.用法介绍 将trang.jar ...
- Java实现xml文件的xsd校验(schema校验)
JDK中的javax.xml包中有能进行schema校验的类库,但只能返回true或false,无法给出确切的错误信息. Dom4j中给出了几种schema校验的思路,本文实现其中一种. Dom4j在 ...
- Java 使用poi导入excel,结合xml文件进行数据验证的例子(增加了jar包)
ava 使用poi导入excel,结合xml文件进行数据验证的例子(增加了jar包) 假设现在要做一个通用的导入方法: 要求: 1.xml的只定义数据库表中的column字段,字段类型,是否非空等条件 ...
- XML文件约束-XSD系统学习之问题整理
前言 如果是没有了解过XSD基本语法的同学们,建议还是先去了解一下XSD的语法,也就是W3C的XSD协议规范,关于这个方面我是在菜鸟教程中学习的,因为不涉及到写出完善的CSD文件,只是出于学习和整理的 ...
- XML文件生成XSD文件的方法
1.下载一个trang.jar 2.把jar包放在文件任意目录下.如:D:\trang 3.并把你的Response.xml文件放在该文件夹下.例: <?xml version="1. ...
- xsd java引用_web.xml文件的 xsd引用(或dtd引用)学习
1. 为什么web.xml会有不同版本的xsd引用: JDK依赖变化: 或 servlet(JAVA EE)自身API的改变: 2. 为什么会有dtd和xsd两个版本的区别 我是在这篇文章中看到的,作 ...
- spring bean xsd验证失败
报错信息:org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.s ...
- java实现xml的xsd验证_Java通过XML Schema校验XML
首页 > 编程语言> 文章详细 Java通过XML Schema校验XML 2020-03-28 10:51:10阅读:77来源:互联网 Java通过XML Schema校验XML XML ...
- java xsd_『XSD校验XML』使用java通过XSD校验XML文件
本文简单介绍使用java语言,通过XSD文件来校验XML文件结构. XML和XSD介绍 MySQL数据迁移和项目魔法计算器都用到了XML文件,这样可以解耦出配置属性,使项目更加灵活,不用动不动就去改动 ...
最新文章
- 安卓相对布局常用语句
- 安徽省2019年普通高校招生文史、理工类最低控制分数线一览表
- Careers support for Masters students cambridge
- SIGIR 2021 | 推荐系统中的自监督图表征学习
- WebGL 利用FBO完成立方体贴图。
- react控制元素的显示或隐藏
- linux find查找文件然后删除,linu查找find命令及删除7天前的文件
- “大数据标准”征稿通知
- Spark SQL整合Hive
- Java 8 Lambda 表达式解析 1
- php docker 化,如何配置一个 Docker 化持续集成的 PHP 开发环境(四)
- 【王道计组笔记】半导体存储器RAM ROM
- 分享一些前端优质的掘金小册,学完技术感觉已经超神了
- 7个顶级资源搜索网站,不知道太可惜了!
- ThingJS学习总结
- 账号权限问题导致数据泄露频发,如何破解“万豪们”的安全难题?
- [经验教程]拼多多退店保证金多久到账 拼多多退店正确操作35天内保证金到账
- 网页回拨-Web CallBack
- 如何使用canvas进行画图
- 中国AGR硅橡胶线行业产销情况与应用前景预测报告(新版)2022-2027