Why doesn't Eclipse allow spring-dwr schema?

Eclipse shows the following errors in my Spring applicationContext.xml:

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 

When I hover over a position error, it also says:

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

I confirmed that the root element is actually <xsd: schema>. When I use autocomplete, typing <dwr: Eclipse correctly shows me various options, such as <dwr: configuration>, <dwr: controller>, etc. How can Eclipse know this without reading the diagram?

I use many different namespaces without problems; DWR is the only one that is not allowed. Here is the announcement:

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

I have the latest DWR 3.0.0.116.rc1 in my classpath. If I rip the can of DWR, I find META-INF / spring.handlers containing:

 http\://www.directwebremoting.org/schema/spring-dwr=org.directwebremoting.spring.DwrAnnotationNamespaceHandler 

and META-INF / spring circuits containing:

 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 

Colon acceleration threw me a little, but I assume that everything is correct, otherwise all DWRs will be broken.

Before I grabbed this particular circuit in real time from the DWR site, but I realized this when my production system crashed because the DWR site was omitted.

+12
spring eclipse xml schema dwr
May 23 '09 at 9:56 a.m.
source share
3 answers

You can try adding a user-specified contribution to Eclipse. In the Window-> Settings-> XML-> XML Catalog section, select Custom Entries , and then the Add button.

Then you can add details for the circuit (you can copy the file locally in case of a dropped connection). Eclipse will then have access to the schema during validation.

+11
Jul 02 '09 at 15:23
source share

I'm not sure your question is here. You seem to answer it yourself in the last paragraph - the DWR site is omitted, the schema check in Eclipse fails. Note that Eclipse (even with the Spring IDE plugin) does not use META-INF / spring.schemas to resolve namespaces that are executed by the Eclipse platform. If the circuit is not found at the circuit location, you will receive these errors.

As for autocomplete, Eclipse will still provide this by outputting from existing structures in your document if it cannot find a schema.

This is not a problem in the application itself, since Spring will use the META-INF / spring.schemas file to resolve schemas from the JAR.

+2
May 25 '09 at 15:58
source share

This is a common problem when using Eclipse offline. He is trying to grab a circuit from the network. When he cannot find it, he indicates a validation error.

I just ignore these errors. When you are online again, clear the project and they will leave.

+2
Jul 23. '09 at 3:13
source share



All Articles