Spring Framework 설정하고 런타임 서버를 올리는 과정에서 발생한 오류이다.

SEVERE: StandardWrapper.

Throwableorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException : Line 13 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 63; cvc-complex-type.2.4.c: 일치하는 와일드 카드 문자가 엄격하게 적용되지만 'context:component-scan' 요소에 대한 선언을 찾을 수 없습니다.

 

분명히 dispatcher-servlet.xml 어딘가에 오타가 있나 싶어 찾아보니 별다른 문제점이 없어 보였지만 sample을 찾아 다른게 뭔가 보았더니 역시 오타가 있었다. 아래와 같이 schemaLocation의 URL 뒤에 /가 붙어있어 발생된 오류였다.

 

수정전

...
xsi:schemaLocation="
    http://www.springframework.org/schema/beans/
    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/context/
    http://www.springframework.org/schema/context/spring-context-3.2.xsd"/>
...

 

수정후

...
xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.2.xsd"/>
...

 

그리고 spring framework의 버전보다 dtd정의에 사용된 버전이 높을 경우에도 발생할 수 있다고 한다.

 

(참고 : http://happytogether.tistory.com/179)



AND