How to run Spring applications offline?

I have a Spring application (not a web application) that should be available for offline use. However, when I try to do this, it crashes with this error message:

- 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)
...

This is because Spring cannot find the schemas because they are online and Spring is disconnected. How to run my Spring applications offline?

+3
source share
2 answers

Spring jars contain META-INF/spring.handlersand files META-INF/spring.schemas. To avoid overwriting files when combining dependencies with one bank, you can use the Maven Shade plugin .

+1
source

. jar. META-INF/spring.schemas. , spring . spring - beans.xsd spring -tool.xsd. :

http://www.springframework.org/schema/beans/spring - beans -3.0.xsd = /springframework/ beans/factory/XML/spring - beans.xsd

spring -tool.xsd, . spring.schemas, :

http://www.springframework.org/schema/tool/spring -tool.xsd = spring -tool.xsd - , , jar.

, . spring - beans. .

0

Source: https://habr.com/ru/post/1770938/


All Articles