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

我确认根元素是实际上的 的。当我通过键入使用自动完成 的Eclipse正确显示我的各种选项等的 的,等。如何可以在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罐子,我发现 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网站已经关闭。

有帮助吗?

解决方案

您可以尝试将用户指定的目录贡献给Eclipse。在窗口 - >首选项 - > XML-> XML目录选择用户指定的条目,然后在添加按钮。

您可以再添加细节的架构(你可以在删除的连接的情况下,本地复制文件)。然后Eclipse将具有验证期间访问架构。

其他提示

我不知道你的问题在这里。你似乎对自己回答的最后一段 - DWR站点关闭,在Eclipse架构验证失败。需要注意的是Eclipse的(即使是春节IDE插件)不使用META-INF / spring.schemas解决的命名空间,这是由Eclipse平台上完成。如果架构不能在架构位置找到,那么你得到这些错误。

至于自动完成,Eclipse将仍然由现有的结构推断你的文档中,如果找不到架构提供了这一点。

这是不是在应用程序本身的问题,因为Spring将使用META-INF / spring.schemas文件从JAR解决模式。

此使用Eclipse离线时是常见的问题。它试图抓住从网络架构。当它不能找到它,它指示验证错误。

我只忽略这些错误。当你上线,清理项目,他们走了。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top