How to avoid downloading a schema file from the Internet during spring initialization

I have a web application running on a production server that does not allow public access to the Internet. Initialization fails, for example,

2010-02-18 15:21:33,150 **WARN**  [SimpleSaxErrorHandler.java:47] Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'https://jax-ws.dev.java.net/spring/servlet.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(ErrorHandlerWrapper.java:195)
 ...

2010-02-18 15:21:33,154 **ERROR** [ContextLoader.java:215] Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in XML document from ServletContext resource [/WEB-INF/app.xml] is invalid; nested exception is org.xml.sax.SAXPar
seException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'.
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)

It seems that the first WARN indicates that the application could not load the schema file, which caused a 2nd error.

My questions:

  • I believe it is reasonable that I should be able to run the application without Internet access. how can I ask the xml parser to use a local schema file instead of a copy downloaded from the internet. I know there is an opportunity in the XML directory. I use tomcat and spring. Is there a way to customize the XML directory? Are there other mechanisms that can achieve the same goal?

  • . xml? , , .

+3
1
+3

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


All Articles