为什么Eclipse不能解析spring-dwr架构? [英] Why can't Eclipse resolve the spring-dwr schema?

查看:530
本文介绍了为什么Eclipse不能解析spring-dwr架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse在我的Spring的applicationContext.xml 中显示以下错误:

Eclipse is showing the following errors in my Spring's 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 my mouse over the line-item 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>.

我确认根元素实际上是< xsd:schema> 。当我使用自动填充键入< dwr:时,Eclipse正确地显示了各种选项,如< dwr:configuration> < dwr:controller> em>等。Eclipse如何知道这一点,而不需要阅读模式?

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

我利用许多不同的命名空间没有问题; DWR架构是唯一没有解决的模式。这是声明:

I make use of many different namespaces without issue; the DWR schema is the only one that isn't being resolved. Here is the declaration:

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

I have the latest DWR 3.0.0.116.rc1 in my classpath. If I crack open the DWR jar, I find META-INF/spring.handlers containing:

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


$ b $包含:

and META-INF/spring.schemas 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

转义的冒号扔了我一点,但我认为这是正确的,否则每个人的DWR将被打破。

The escaping of the colon threw me off a bit, but I assume it's all correct, otherwise everyone's DWR would be broken.

在我从实时抓取这个特定的模式之前DWR网站,但是当我的制作系统因为DWR网站关闭而崩溃时,我很有帮助。

Before I was grabbing this particular schema in real time from the DWR website, but I got bit by this when my production system crashed because the DWR site was down.

推荐答案

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

You could try adding a user specified catalog contribution to Eclipse. Under Window->Preferences->XML->XML Catalog select User Specified Entries and then the Add button.

然后,您可以添加模式的详细信息(您可以在丢弃连接的情况下在本地复制文件)。然后,Eclipse将在验证期间访问模式。

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

这篇关于为什么Eclipse不能解析spring-dwr架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆