2014-02-14 7 views
8

Ich habe ein Problem mit meiner Datei "applicationContext.xml".SAXParseException, Schema-Dokument konnte nicht gelesen werden

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

ich diesen Fehler:

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

Was ist das?

Antwort

8

Das bedeutet, dass die Schemadatei für die Anwendung nicht verfügbar war.

Sie haben ein paar Optionen, diese zu lösen:

  • Überprüfen Sie die Internetverbindung und Proxy-Einstellungen (höchstwahrscheinlich der SAX-Parser kann nicht holen aufgrund einiger Verbindungsprobleme)
  • einfach die Schemadatei herunterladen, Fügen Sie es Ihrem Klassenpfad hinzu, und ändern Sie den Speicherort des Schemas so, dass er auf Ihre heruntergeladene Datei verweist.
+2

Das Herunterladen des Schemas und das lokale Referenzieren funktionierte für mich, aber das ist verwirrend. Warum sollte der Server diese Datei plötzlich nicht aus dem Netz laden? :( –

+0

Ich bin sehr verwundert über obligatorische Internetverbindung für meine Anwendung – gstackoverflow

+1

Für mich wird die Anwendung von der Eclipse ausgeführt, aber die Jar-Ausführung schlägt von der Befehlszeile mit dem gleichen SAX-Fehler. Gibt es einige zusätzliche Konfiguration usw., dass steuert die Ausführung über die Befehlszeile – Amal

Verwandte Themen