[ERR] 심각한 파싱 오류 발생. org.xml.sax.SAXParseException; systemId: file: .../WEB-INF/web.xml; lineNumber: 1; columnNumber: 39; Premature end of file. org.apache.tomcat.util.descriptor.web.WebXmlParser parseWebXml

아무튼 간에·2022년 4월 6일
0

에러/오류

목록 보기
5/9

개발환경

OS: Windows 10
IDE: eclipse 2022-03
JAVA: 17
Tomcat: 9.0


상황

Makers에 오류가 없으니 실행할 때 톰캣이 web.xml을 못 읽겠다고 난리구나...

나의 web.xml엔 읽을 것이 없는데...


해결

다른 플젝은 기본적으로 항상 <web-app></web-app> 태그 값이 있었는데 이 플젝은 없는게 이상해서 혹시나 하고 비어있는 태그를 넣어줬더니 해결됨!

어째서...?

web.xml은 웹 애플리케이션의 기본설정을 위해 작성하는 파일.
최상단의 <?xml version="1.0" encoding="UTF-8"?>는 xml 파일임을 알리는 태그.
<web-aap> 태그는 web.xml의 트루 엘리먼트로 모든 웹 애플리케이션 설정은 이 태그 사이에 위치해야만 됨.

보통은
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> 이런 스키마 정의가 함께 작성되는데 이 프로젝트는 아예 태그 생성조차 되어있지 않았다. import한 소스의 초기 설정을 잘 못 잡은 건지, 애초에 이런 구조로 설정된 건지 확인해 봐야할 듯.


참고

profile
armton garnet

0개의 댓글