2016-05-12 40 views
4

我正在使用ehcache和Spring。最近注意到下面的錯誤。此外,XSD文件現在丟失在http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd與春天ehcache。谷歌代碼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:在org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd 在sun.net.www.protocol.http.HttpURLConnection.getInputStream(未知來源) (未知來源) at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source) at org.apache.xerces.impl .xs.opti.SchemaParsingConfig.parse(Unknown Source) at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(Unknown Source) ... 38更多

回答

5

問題是您請求的URL直接來自Google Code源代碼庫。谷歌宣佈去年3月份正在關閉Google Code,本週早些時候Google開始實際關閉其源代碼託管服務。

您需要找到該文件的新主機。例如DropBox的,Google雲端硬盤等。如果您需要舊版本的副本,請參閱歸檔版本在:

https://code.google.com/archive/p/ehcache-spring-annotations/source/default/source

+0

我有下載和主機文件的Ehcache-彈簧1.1.xsd。到DropBox和現在相同的問題again.Can你指導我如何我可以訪問此文件。 –

+0

您只需將絕對路徑網址更改爲code.google.com,並在其中上傳xsd文件的新網址。是工作! –

0

克里斯·史密斯的回答使我在正確的方向,我的問題有一個版本略高ehcache-spring-1.2.xsd 。克里斯說,你的版本,我的版本和1.0版本都比較老,不再託管。

如果您不信任其他主機,那麼我建議您下載存檔,解壓縮並將必要的文件添加到項目中,並通過相對路徑引用文件。

欲瞭解更多詳情,您可以在How to Configure Eclipse to Work with `ehcache`閱讀我相關的問題/答案和How to Reference Local XSD File By Relative Path