2010-10-22 54 views
3

我有一個應用程序可以脫機運行的Spring應用程序(不是Web應用程序)。然而,當我試圖做到這一點,它崩潰,出現此錯誤消息:如何離線運行我的Spring應用程序?

- Loading XML bean definitions from class path resource [applicationContext.xml] 
21220 [main] WARN org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
- Ignored XML validation warning 
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tool/spring-tool-3.0.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 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(Unknown Source) 
... 

這是由彈簧引起了不能夠找到的模式,因爲他們是在網上和Spring處於脫機狀態。我如何離線運行我的Spring應用程序?

+1

重複。參見: - http://stackoverflow.com/questions/1729307/spring-schemalocation-fails-when-there-is-no-internet-connection - http://stackoverflow.com/questions/2293415/how-to-avoid -interload-schema-file-from-internet-during-spring-initialization等。 – kaliatech 2010-10-22 15:02:01

回答

1

彈簧瓶包含META-INF/spring.handlersMETA-INF/spring.schemas文件。爲避免在將依賴關係聚合到一個jar時覆蓋這些文件,可以使用Maven Shade plugin

相關問題