Multiple annotations found at this line: Failed to read schema document

roon2020·2021년 3월 4일
0

spring

목록 보기
7/16
post-thumbnail

spring mvc 프로젝트를 새로 만들고 pom.xml에서 오류가 발생해서 해결 방법을 정리합니다.

오류 메시지

Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'https://maven.apache.org/maven-v4_0_0.xsd',
because
1) could not find the document;
2) the document could not be read;
3)the root element of the document is not <xsd:schema>.- cvc-elt.1: Cannot find the declaration of element 'project'.

메시지를 봐도 원인이 무엇인지 잘 모르겠습니다.
그래도 "Failed to read schema document ~" 부분이 핵심인거 같아 검색을 해봤습니다.
딱 맞는 답변은 없었지만 설정파일의 문제같다고 생각했습니다.

해결

설정 파일이 여러개였던 것이 문제였습니다.
프로젝트를 새로 만들면서 자바 설정을 이용할 것이기때문에 xml 설정과 관련된 것은 지웠어야 했습니다.
root-context.xml , servlet~.xml,web.xml 을 삭제하고 maven-update를 해주면 해결됩니다.
해결하고 보니 "multiple annotation found"라는 메시지가 왜 발생했는지 이해가 됐습니다.

profile
keep in positive mindset. I've got this.

0개의 댓글