xsi:noNamespaceSchemaLocation使用心得
来源:互联网 发布:淘宝收藏加购物车软件 编辑:程序博客网 时间:2024/06/05 07:18
在使用ehcache的时候碰到一个问题:
分析下来就是 ehcache.xml文件加载出问题了,根据错误可以看出是"ehcache"节点无法解析,那么首先就可以想到是描述文件出错ehcache.xsd;
为什么加载不到呢在本地直接
发现确实是链接不到服务器,发现是内网机器无法访问网络;
定位到问题首先想到的就是,那把ehcache.xsd下载到本地直接读,思路是正确的,只是文件路径的设置需要注意一下
比如:
如果,ehcache.xsd 和 ehcache.xml文件同目录下面
这样配置是错误的,加载不了的;
那么要如何配置?
看了一下源代码
Resource:我首先想到的就是:classpath:META-INF/spring/ehcache.xsd
没有仔细看,直接改上去:
- is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'ehc
- ache'
- Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'ehcache'
分析下来就是 ehcache.xml文件加载出问题了,根据错误可以看出是"ehcache"节点无法解析,那么首先就可以想到是描述文件出错ehcache.xsd;
为什么加载不到呢在本地直接
- curl -X GET http://ehcache.org/ehcache.xsd
发现确实是链接不到服务器,发现是内网机器无法访问网络;
定位到问题首先想到的就是,那把ehcache.xsd下载到本地直接读,思路是正确的,只是文件路径的设置需要注意一下
比如:
如果,ehcache.xsd 和 ehcache.xml文件同目录下面
- <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="ehcache.xsd"
- updateCheck="false" dynamicConfig="false">
这样配置是错误的,加载不了的;
那么要如何配置
- xsi:noNamespaceSchemaLocation=""
看了一下源代码
- org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(InputSource inputSource, Resource resource)
Resource:我首先想到的就是:classpath:META-INF/spring/ehcache.xsd
没有仔细看,直接改上去:
- <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="classpath:META-INF/spring/ehcache.xsd"
- updateCheck="false" dynamicConfig="false">
阅读全文
0 0
- xsi:noNamespaceSchemaLocation使用心得
- XSI
- XSI
- POSIX&XSI
- xsi xsd
- POSIX && XSI
- 使用XmlSchemaValidator验证XmlElement,当xsi:nil=true时,使用专门的重载方法
- xml中的xmlns,xmlns:xsi,xsi:schemaLocation
- xml xmlns xmlns:xsi xsi:schemaLocation含义
- 使用HtmlParser使用心得
- libcurl使用心得libcurl使用心得
- freemarker的使用心得,freemarker使用心得
- xsi:schemaLocation详解
- xsi:nil="true"
- xsi:schemaLocation详解
- XML xmlns xsi解释
- xml 中的xsi 是什么意思
- xsi:schemaLocation详解
- python scrapy库安装过程提示错误 Running setup.py install for Twisted ... error
- ztree checkbox父子联动
- PHP问题:Deprecated: Function split() is deprecated in解决方法
- php安装openssl 扩展
- 读取高光谱数据头文件—C语言
- xsi:noNamespaceSchemaLocation使用心得
- 图论算法和数据结构_绪论
- c++类的构造函数详解
- RTP封包的C语言实现
- IP问问:使用中的那些常见问题大集合
- ARM汇编记录
- matlab如何计算一幅图像的Byte数
- web--前端之js代码4
- Linux文件空洞与稀疏文件