Eclipse 在我的 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
当我将鼠标悬停在订单项错误上时,它还会显示:
- 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>.
我确认根元素实际上是<xsd:schema>。当我通过键入<dwr:使用自动完成功能时, Eclipse 正确地向我显示了各种选项,例如<dwr:configuration>、<dwr:controller>等。Eclipse 如何在不阅读架构的情况下知道这一点?
我毫无问题地使用了许多不同的名称空间;DWR 模式是唯一未解决的模式。这是声明:
<?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">
我的类路径中有最新的 DWR 3.0.0.116.rc1。如果我打开 DWR jar,我会发现META-INF/spring.handlers包含:
http\://www.directwebremoting.org/schema/spring-dwr=org.directwebremoting.spring.DwrAnnotationNamespaceHandler
和META-INF/spring.schemas包含:
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
冒号的逃逸让我有点失望,但我认为这一切都是正确的,否则每个人的 DWR 都会被破坏。
在我从 DWR 网站实时获取此特定模式之前,但当我的生产系统因 DWR 网站关闭而崩溃时,我被此所困扰。