Eclipse sta mostrando i seguenti errori nella mia primavera applicationContext.xml:Perché Eclipse non può risolvere lo schema spring-dwr?
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:configuration'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 23 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:controller'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 21 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr:remote'. myappservlet-servlet.xml MyApp/src/main/webapp/WEB-INF line 41 XML Problem
Quando mi passa il mouse il mouse sopra l'errore di linea-oggetto, si dice anche:
- schema_reference.4: Failed to read schema document 'http://www.directwebremoting.org/
schema/spring-dwr-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>.
mi ha confermato che l'elemento radice è infatti < xsd: schema>. Quando uso di completamento automatico, digitando < DWR: Eclipse mi mostra correttamente le varie opzioni come < dwr: Configurazione>, < DWR: Controller>, ecc Come può Eclipse conosce questo senza leggere lo schema?
Uso diversi spazi dei nomi diversi senza problemi; lo schema DWR è l'unico che non è stato risolto. Ecco la dichiarazione:
<?xml version="1.0" encoding="utf-8"?>
<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"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd"
default-autowire="byName">
Ho l'ultima 3.0.0.116.rc1 DWR nel mio percorso di classe. Se ho crack aprire il barattolo DWR, trovo META-INF/spring.handlers contenente:
http\://www.directwebremoting.org/schema/spring-dwr=org.directwebremoting.spring.DwrAnnotationNamespaceHandler
e META-INF/spring.schemas contenenti:
http\://www.directwebremoting.org/schema/spring-dwr-2.0.xsd=org/directwebremoting/spring/spring-dwr-2.0.xsd
http\://www.directwebremoting.org/schema/spring-dwr-3.0.xsd=org/directwebremoting/spring/spring-dwr-3.0.xsd
La fuga di il colon mi ha respinto un po ', ma presumo sia tutto corretto, altrimenti il DWR di tutti sarebbe stato rotto.
Prima di prendere questo particolare schema in tempo reale dal sito Web del DWR, ma sono rimasto un po 'per questo quando il mio sistema di produzione si è arrestato in modo anomalo perché il sito DWR era inattivo.
C'è un modo per farlo quando il file .xsd si trova all'interno di un file .jar? La configurazione in '/ META-INF/spring.schemas' dovrebbe essersi già occupata di questo? – Stewart