복붙노트

[SPRING] IntelliJ IDEA가 잘못된 XSD를 확인합니다.

SPRING

IntelliJ IDEA가 잘못된 XSD를 확인합니다.

다음 트랜잭션 관리자를 정의했습니다.

    <tx:annotation-driven transaction-manager="txManager" mode="aspectj" />

다음 루트 요소가 있어야합니다.

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

모든 것이 잘 작동하지만 IntelliJ는 나에게 오류 마커를 표시합니다.     모드 = "aspectj" 그것은 허용되지 않는다고 말했습니다. 나는 xsd를 가져온 곳을 따라 갔고, tx 2.0 xsd에 링크되어있다. - 모드 주석을 사용하려면 2.5가 필요하므로 오류 메시지를 설명한다.

어떻게 든 IntelliJ에게 2.0보다는 2.5에 대해 검증해야한다는 힌트를 줄 수 있습니까?

해결법

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

    1.이 스크린 샷에 따라 schemaLocation이 xsd를 가리켜 야하는 jar 파일을 열면 다음과 같이됩니다.

    이 스크린 샷에 따라 schemaLocation이 xsd를 가리켜 야하는 jar 파일을 열면 다음과 같이됩니다.

    그런 다음 IntelliJ에는 다양한 버전의 Spring에 대해 xsd 파일이 많이 있음을 알 수 있습니다.

    이것은 당신이 정말로 필요한 모든 스키마를 가지고 있음을 의미합니다.

    bean 정의 파일에 문제가 있다면 schemaLocation은 Spring jar 파일의 잘못된 버전을 가리켜 야한다.

    설정 | 스키마 및 DTD를 수정하고 실수로 잘못된 xsd 파일을 가리 키도록 실수로 설정하지 않았는지 확인하십시오.

    그것이 틀린 경우 빼기 기호를 사용하여 해당 행을 제거해야합니다. 그러면 IntelliJ가 기본값으로 돌아갑니다.

    그 후 첫 번째 스크린 샷과 같은 것을보아야합니다.

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

    2.나는 같은 보안 문제와 같은 보안 문제를 겪고 있었다. IntelliJ는 버전 3.1을 사용하라는 모든 내용에도 불구하고 보안 xsd 버전 2.0을 사용하여 유효성을 검사 할 것을 주장했습니다.

    나는 같은 보안 문제와 같은 보안 문제를 겪고 있었다. IntelliJ는 버전 3.1을 사용하라는 모든 내용에도 불구하고 보안 xsd 버전 2.0을 사용하여 유효성을 검사 할 것을 주장했습니다.

    IntelliJ가 보안과 빈 사이의 기본 네임 스페이스를 변경하여이를 파악할 수있었습니다.

    나는 원래 :

    <beans:beans xmlns="http://www.springframework.org/schema/security"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:beans="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
    

    그래서 나는 그것을 다음과 같이 바꿨다.

    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:security="http://www.springframework.org/schema/security"
           xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
    

    그 후에 IntelliJ는 올바른 xsd를 사용하여 유효성을 검사합니다. 이것이 IntelliJ 또는 내가 잘못하고있는 버그인지 잘 모르겠지만 지금은 작동합니다.

    바라기를 이것은 미래에 누군가를 도울 것입니다.

  3. from https://stackoverflow.com/questions/16913810/intellij-idea-validates-toward-wrong-xsd by cc-by-sa and MIT license