2014-02-14 8 views
8

У меня возникла проблема с моим файлом applicationContext.xml.SAXParseException, не удалось прочитать документ схемы

<?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> 

Я получаю эту ошибку:

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

Что это значит?

ответ

8

Это означает, что файл схемы недоступен для приложения.

У вас есть несколько вариантов, чтобы решить это:

  • Проверьте подключение к Интернету и настройка прокси-сервера (наиболее вероятно SAX парсер не может извлечь его из-за некоторые проблемы с подключением)
  • Просто скачайте файл схема, добавьте его в свой путь к классам и измените местоположение схемы, чтобы указать на загруженный файл.
+2

Загрузка схемы и ссылка на нее локально работала для меня, но это сбивает с толку. Почему сервер вдруг не смог загрузить этот файл из сети? :( –

+0

Мне было очень интересно об обязательном подключении к Интернету для моего приложения – gstackoverflow

+1

Для меня приложение выполняется из Eclipse, но выполнение jar не выполняется из командной строки с той же ошибкой SAX. Есть ли какая-то дополнительная конфигурация и т. Д., Что управляет выполнением из командной строки. – Amal

Смежные вопросы