使用 Spring 的 ehcache。 google 代码 xsd 找不到文件
ehcache with Spring. google code xsd file not found
我在 Spring 中使用 ehcache。最近注意到以下错误。此外 XSD 文件现在丢失在 http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd。
如果有在本地加载 XSD 的解决方法,请告诉我。
org.xml.sax.SAXParseException; lineNumber: 164; columnNumber: 59; schema_reference.4: Failed to read schema document 'http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
原因:java.io.FileNotFoundException:http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(来源不明)
在 org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(来源不明)
在 org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(来源不明)
在 org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(来源不明)
在 org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(来源不明)
在 org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(来源不明)
... 还有 38 个
问题是您请求的 URL 是直接从 Google 代码源存储库提供的。 Google 宣布将在去年 3 月关闭 Google Code,本周早些时候 Google 开始实际关闭其源代码托管服务。
您需要为该文件找到一个新的主机。例如DropBox、GoogleDrive 等。如果您需要旧版本的副本,请查看存档版本:
https://code.google.com/archive/p/ehcache-spring-annotations/source/default/source
Chris Smith 的回答引导我朝着正确的方向前进,因为我的问题是版本稍高 ehcache-spring-1.2.xsd
。你的版本、我的版本和 1.0 都比较旧,不再像 Chris 所说的那样托管。
如果您不信任其他主机,那么我建议您下载存档、解压缩并将必要的文件添加到您的项目并通过相对路径引用这些文件。
更多详细信息,您可以在How to Configure Eclipse to Work with `ehcache` and How to Reference Local XSD File By Relative Path
中阅读我的相关question/answers
最近遇到了与 POJLP(Plain Old Java/JEE Legacy Project...^^)相同的问题,并求助于使用“straight-to-point”plain GitHub URL:https://raw.githubusercontent.com/agentgt/ehcache-spring-annotations/master/core/src/main/resources/com/googlecode/ehcache/annotations/ehcache-spring-1.1.xsd
...并且 它有效!™。
我在 Spring 中使用 ehcache。最近注意到以下错误。此外 XSD 文件现在丢失在 http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd。
如果有在本地加载 XSD 的解决方法,请告诉我。
org.xml.sax.SAXParseException; lineNumber: 164; columnNumber: 59; schema_reference.4: Failed to read schema document 'http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
原因:java.io.FileNotFoundException:http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd 在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(来源不明) 在 org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(来源不明) 在 org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(来源不明) 在 org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(来源不明) 在 org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(来源不明) 在 org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(来源不明) ... 还有 38 个
问题是您请求的 URL 是直接从 Google 代码源存储库提供的。 Google 宣布将在去年 3 月关闭 Google Code,本周早些时候 Google 开始实际关闭其源代码托管服务。
您需要为该文件找到一个新的主机。例如DropBox、GoogleDrive 等。如果您需要旧版本的副本,请查看存档版本:
https://code.google.com/archive/p/ehcache-spring-annotations/source/default/source
Chris Smith 的回答引导我朝着正确的方向前进,因为我的问题是版本稍高 ehcache-spring-1.2.xsd
。你的版本、我的版本和 1.0 都比较旧,不再像 Chris 所说的那样托管。
如果您不信任其他主机,那么我建议您下载存档、解压缩并将必要的文件添加到您的项目并通过相对路径引用这些文件。
更多详细信息,您可以在How to Configure Eclipse to Work with `ehcache` and How to Reference Local XSD File By Relative Path
中阅读我的相关question/answers最近遇到了与 POJLP(Plain Old Java/JEE Legacy Project...^^)相同的问题,并求助于使用“straight-to-point”plain GitHub URL:https://raw.githubusercontent.com/agentgt/ehcache-spring-annotations/master/core/src/main/resources/com/googlecode/ehcache/annotations/ehcache-spring-1.1.xsd
...并且 它有效!™。