• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

파일 업로드 부분에서 이녀석이 계속 에러가 뜨네요

23.03.24 22:49 작성 조회수 1.28k

0

파일업로드 문제.png

java.lang.Error: Unresolved compilation problems:

The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files

The method parseRequest(HttpServletRequest) from the type ServletFileUpload refers to the missing type HttpServletRequest

톰캣 10버전을 쓰고 있는데 자꾸 javax로 인식하고 있는 것 같습니다.....
임포트 부분을 보면 jakarta로 받고 있는데 왜 이런 에러가 생기는지 알 수 있을까요?

답변 1

답변을 작성해보세요.

0

이 오류에서 ServletFileUpload 클래스의 parseRequest 메서드가 HttpServletRequest 타입을 참조하지만 찾을 수 없다고 언급되어 있습니다. 관련 해당 클래가 잘 import 되었는지도 확인해보시구요.

Maven pom.xml에 아래 디펜던시를 넣고 다시한번 Maven Update를 수행해보시기 바랍니다.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>