Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAXParseException, failed to read schema document

Tags:

spring

I got a problem with my applicationContext.xml file.

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
xmlns:security="http://www.springframework.org/schema/security" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd      
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">  

<import resource="classpath:spring/persistence.xml"/>

<context:annotation-config />
<context:component-scan base-package="com.sgcib.mrp.cva"/> 

<util:properties id="jdbcProps" location="jdbc.properties" />   

<bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
         <value>classpath:configuration.properties</value>
         <value>classpath:jdbc.properties</value>
        </list>
    </property>
</bean>

I get this error :

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-3.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>.

What does it mean ?

like image 216
l0r3nz4cc10 Avatar asked Feb 14 '14 10:02

l0r3nz4cc10


1 Answers

That means that the schema file was not available to the application.

You have a few options to solve this:

  • Check the internet connection and proxy settings (most probably the SAX parser cannot fetch it due to some connection problems)
  • Just download the schema file, add it to your classpath and change the schema location to point to your downloaded file.
like image 193
WeMakeSoftware Avatar answered Nov 10 '22 06:11

WeMakeSoftware