[ 오류 해결 ]

[sts4] spring 에러 - The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path / javax.servlet.ServletException cannot be resolved to a type

히앤님 2020. 12. 2. 10:47
반응형
SMALL

workspace 파일을 옮겼더니 에러 발생.

에러는 다음과 같다.

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

 

Multiple annotations found at this line: 

- javax.servlet.ServletException cannot be resolved to a type 

- javax.servlet.jsp.PageContext cannot be resolved to a type

- javax.servlet.jsp.JspException cannot be resolved to a type

 

환경이 바뀌어서 제대로 서버환경을 안 잡아줘서 생기는 오류였다.


●해결 방법

1. 오류가 발생한 프로젝트  우클릭 → Properties

2. Java Build Path → Add Library

3. Server Runtime 선택

4. 제대로 Tomcat을 설정해준다.

톰캣 두개

나의경우 워크스페이스 자체를 옮기는 바람에 함께 있던 톰캣이 꼬여버린듯. 그래서 새로 다시 연결해주었다.

실행에는 별 문제 없음.

반응형
LIST