Hello;
ello;
I am running Spring MVC project and when I reached for deployment (I generated WAR file for deployment team and they use it to do the deployment), I faced an error that we were not see it when we were running the project from eclipse (Run as Maven Build). I am sure this is because the deployment is happening on machine that does not have Internet. The error is related to downloading the XSD file that is needed in the root-context.xml file.
The warn is saying:
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
WARN : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber:
4
; columnNumber:
129
; schema_reference.
4
: [b]Failed to read schema document
'https://www.springframework.org/schema/beans/spring-beans.xsd'
[/b], 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>.
And the error:
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
4
in XML document from ServletContext resource [/WEB-INF/spring/root-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber:
4
; columnNumber:
129
; cvc-elt.
1
: Cannot find the declaration of element
'beans'
.
I know that I have to place the spring-beans.xsd file locally and change the xml configuration to direct for it, but I do not know in which path I have to place this file and what the configuration that I have to place in the root-context.xml file to be able to find this file.
From the other side, I am posting here the root-context.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<import resource="nep-api-proxy.xml"/>
Appreciate your kindly help please.
Regards
Bilal