일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- github
- jQuery
- Oracle SQL
- git
- Bootstrap
- JavaScript
- SQL
- group by
- HTTP Status 500
- 이클립스
- 성적프로그램
- 부트스트랩
- rownum
- Oracle DB
- JSP
- sql developer
- 모조칼럼
- Java
- 제약조건
- oracle
- distinct
- 답변형 게시판
- HTTP Status 404
- ||
- 한글 인코딩
- CRUD
- 과정평가형
- HTML
- alias
- tomcat
Archives
초급의 끄적거림
[Spring] 오류 'mvc:annotation-driven' 요소에 대한 선언을 찾을 수 없습니다. 본문
Framework/Spring
[Spring] 오류 'mvc:annotation-driven' 요소에 대한 선언을 찾을 수 없습니다.
codingD 2021. 4. 14. 21:34오류문구
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 30; cvc-complex-type.2.4.c: 일치하는 와일드 카드 문자가 엄격하게 적용되지만 'mvc:annotation-driven' 요소에 대한 선언을 찾을 수 없습니다.
원인
- dispatcher-servlet.xml 에 xmlns:mvc 와 xmlns:context 를 추가한 후에 xsi:schemaLocation 에 동일한 해당 경로를 추가해주어야 하는데 추가 하지 않음
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
해결방법
- 해당 경로와 일치하도록 추가 진행
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
<mvc:annotation-driven />
<context:component-scan base-package="my.payment.controller" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
'Framework > Spring' 카테고리의 다른 글
[Spring] Static Resources 매핑 (0) | 2020.11.18 |
---|---|
[어노테이션] @RequestMapping / @RequestParam (0) | 2020.07.03 |
[Spring] Tomcat version 8.5 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5, 6, and 7 Web modules (0) | 2020.04.26 |
[Spring] 애플리케이션 계층 / 단일 책임 원칙 (0) | 2020.04.21 |
[Spring] project configuration is not up-to-date with pom.xml (0) | 2020.04.12 |
Comments