복붙노트

[SPRING] Eclipse가 spring-dwr 스키마를 해석 할 수없는 이유는 무엇입니까?

SPRING

Eclipse가 spring-dwr 스키마를 해석 할 수없는 이유는 무엇입니까?

이클립스는 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에서 스키마를 읽지 않고이를 어떻게 알 수 있습니까?

문제없이 많은 다른 네임 스페이스를 사용합니다. 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 사이트가 다운 되었기 때문에 프로덕션 시스템이 손상되었을 때이 점을 조금 이나마 깨달았습니다.

해결법

  1. ==============================

    1.Eclipse에 사용자가 지정한 카탈로그 기여를 추가 할 수 있습니다. Window-> Preferences-> XML-> XML Catalog에서 User Specified Entries를 선택한 다음 Add 버튼을 선택하십시오.

    Eclipse에 사용자가 지정한 카탈로그 기여를 추가 할 수 있습니다. Window-> Preferences-> XML-> XML Catalog에서 User Specified Entries를 선택한 다음 Add 버튼을 선택하십시오.

    그런 다음 스키마에 대한 세부 사항을 추가 할 수 있습니다 (연결이 끊어진 경우 파일을 로컬로 복사 할 수 있음). Eclipse는 유효성 검사 중에 스키마에 대한 액세스 권한을 갖습니다.

  2. ==============================

    2.나는 당신의 질문이 여기에 있는지 모르겠습니다. DWR 사이트가 다운되고 Eclipse의 스키마 유효성 검사가 실패하는 마지막 단락에서 직접 대답하는 것 같습니다. Eclipse (Spring IDE 플러그인을 사용하는 경우에도)는 Eclipse 플랫폼에서 수행 한 META-INF / spring.schemas를 사용하여 네임 스페이스를 확인하지 않습니다. 스키마 위치에서 스키마를 찾을 수 없으면 이러한 오류가 발생합니다.

    나는 당신의 질문이 여기에 있는지 모르겠습니다. DWR 사이트가 다운되고 Eclipse의 스키마 유효성 검사가 실패하는 마지막 단락에서 직접 대답하는 것 같습니다. Eclipse (Spring IDE 플러그인을 사용하는 경우에도)는 Eclipse 플랫폼에서 수행 한 META-INF / spring.schemas를 사용하여 네임 스페이스를 확인하지 않습니다. 스키마 위치에서 스키마를 찾을 수 없으면 이러한 오류가 발생합니다.

    자동 완성과 관련하여 Eclipse는 스키마를 찾을 수없는 경우에도 문서의 기존 구조를 추론하여이를 제공합니다.

    Spring은 META-INF / spring.schemas 파일을 사용하여 JAR에서 스키마를 분석하므로 응용 프로그램 자체에서는 문제가되지 않습니다.

  3. ==============================

    3.이 문제는 Eclipse를 오프라인에서 사용할 때 흔히 발생하는 문제입니다. 그것은 그물에서 스키마를 잡으려고합니다. 찾을 수없는 경우 유효성 검사 오류를 나타냅니다.

    이 문제는 Eclipse를 오프라인에서 사용할 때 흔히 발생하는 문제입니다. 그것은 그물에서 스키마를 잡으려고합니다. 찾을 수없는 경우 유효성 검사 오류를 나타냅니다.

    나는 단지 이러한 오류를 무시합니다. 다시 온라인 상태가되면 프로젝트를 정리하면 사라집니다.

  4. from https://stackoverflow.com/questions/901242/why-cant-eclipse-resolve-the-spring-dwr-schema by cc-by-sa and MIT license