복붙노트

[SPRING] 봄 3 스키마를로드 할 수 없습니다.

SPRING

봄 3 스키마를로드 할 수 없습니다.

나는 봄 3.0.5를 사용하고있다. 그리고 오늘 maven을 사용하여 프로젝트를 빌드 할 때 appicationContext.xml 파일에서 다음 오류가 발생합니다.

 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 
     'context:component-scan'.
 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-
 config'.
 - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-
     driven'.

나는 스키마 링크를 열려고 시도 :

그러나 나는 항상 금지 된 페이지를 얻는다!

여기에 applicationContext.xml을 구성하는 방법이 나와 있습니다.

<?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:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="
           http://www.springframework.org/schema/beans     
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context 
           http://www.springframework.org/schema/context/spring-context-3.0.xsd">

이 오류를 수정하는 방법을 알려주십시오.

해결법

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

    1.공개 스키마가 더 이상 사용할 수없는 것, 그래서 클래스 패스에 병에서 스키마를로드하는 대신 다음과 같습니다 :

    공개 스키마가 더 이상 사용할 수없는 것, 그래서 클래스 패스에 병에서 스키마를로드하는 대신 다음과 같습니다 :

    <?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:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx" 
        xmlns:p="http://www.springframework.org/schema/p"
        xsi:schemaLocation="  
               http://www.springframework.org/schema/beans 
               classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd
               http://www.springframework.org/schema/tx
               classpath:/org/springframework/transaction/config/spring-tx-3.0.xsd
               http://www.springframework.org/schema/context  
               classpath:/org/springframework/context/config/spring-context-3.0.xsd">
    
  2. ==============================

    2.이 문제가 발생하고있는 것 같습니다 : Spring Beans Schema를 더 이상 웹에서 사용할 수 없습니까? schemaLocation을 명시 적으로 정의하고 있습니까?

    이 문제가 발생하고있는 것 같습니다 : Spring Beans Schema를 더 이상 웹에서 사용할 수 없습니까? schemaLocation을 명시 적으로 정의하고 있습니까?

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/context/spring-context-3.0.xsd
                            ">
    
  3. from https://stackoverflow.com/questions/10687511/cant-load-spring-3-schemas by cc-by-sa and MIT license