2012-09-07 21 views
13

Mentre iniziare la mia Primavera App, sto ottenendo il seguente errore:non è riuscito a leggere il documento schema 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd'

WARNING: Ignored XML validation warning 
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document  
'http://www.springframework.org/schema/beans/spring-beans-3.0.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>. 

mio SpringApp-servlet.xml è la seguente:

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
xmlns:aop="http://www.springframework.org/schema/aop"  
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 
<bean name="/hello.htm" class="springapp.web.HelloController"/> 
</beans> 

si prega di suggerire.

risposta

2
<beans 
    xmlns="http://www.springframework.org/schema/beans" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:security="http://www.springframework.org/schema/security" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 
     http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
+11

Potresti spiegare per favore cosa hai cambiato esattamente? – FracturedRetina

+1

non ha risolto il mio problema – Igal

+0

http://www.gontu.org/wp-content/uploads/2014/08/Spring05.zip –

3

Quando ho ricevuto questo messaggio di errore, era semplicemente a causa di un vaso mancante nel mio CLASSPATH. Alcune applicazioni primaverili sembrano essere molto affamate di vasi di primavera. La mia app ha bisogno di tutte queste cose sul classpath:

${OTS_DIR}/org.springframework.aop-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.aspects-${VERSION}.jar:\ 
${OTS_DIR}/com.springsource.org.aopalliance-${AOPALLIANCE_VER}.jar:\ 
${OTS_DIR}/org.springframework.asm-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.beans-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.context-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.core-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.expression-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.jdbc-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.jms-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.orm-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.transaction-${VERSION}.jar:\ 
${OTS_DIR}/org.springframework.instrument-${VERSION}.jar 
Problemi correlati