Failed to read schema document "http://www.springframework.org/schema/tool/spring-tool-4.1.xsd"

When loading the context of my spring application, I get the following error ( only on a Linux machine, it somehow works on Windows ):

Failed to read the schema document ' http://www.springframework.org/schema/tool/spring-tool-4.1.xsd ' because 1) the document could not be found; 2) the document cannot be read; 3) the root element of the document is not xsd: schema.

The following is Stacktrace:

org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/score/context/scoreRepositoryContext.xml] 2015-03-30 11:07:49:336 127901 [main] WARN org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/tx/spring-tx.xsd; lineNumber: 12; columnNumber: 150; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tool/spring-tool-4.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 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:433) at ... at org.springframework.shell.Bootstrap.main(Bootstrap.java:58) Caused by: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) 

Any idea why?

+2
java spring xml xsd
Apr 6 '15 at 12:51 on
source share
1 answer

The problem is almost certainly related to the Spring library version issue.

Update Spring libraries on a Linux machine :

Make sure that there are no conflicting jars (different spring versions) on the class path. If you are using Spring 3.0, then there should not be a lot of fat spring.jar (which is Spring 2.5 and earlier). Then, if you are creating a jar of uber that contains all the packages, make sure you copy xsd as well.

[ Credit : Marten Deinum (as stated above), and Tristan and Michael Lee improved on this response by removing the network connection verification offer.]

+5
Apr 6 '15 at 13:41
source



All Articles