본문 바로가기
ETC/오류해결

[Spring] web.xml cvc-elt.1.a: Cannot find the declaration of element 'web-app'

by heekng 2021. 5. 26.
반응형

cvc-elt.1.a: Cannot find the declaration of element 'web-app' 오류 해결방법

스프링에서 servlet 버전을 3.1로 올린 후

web.xml에서 위와 같은 오류가 발생

xsi:schemaLocation의 버전부분만 3_1로 변경하면 되는줄 알았는데

xmlns과 xsi:schemaLocation 둘다 servlet 3.1버전에 맞게 수정해야 한다.

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	version="3.1">

위와 같이 수정하여 해결

 

참고자료

https://www.ibm.com/docs/ko/was-liberty/base?topic=31-servlet-behavior-changes 

 

반응형