🔻Back-End/Spring

[Spring error]Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

_니지 2022. 10. 29. 23:12

❗해결 방법

오류 발생

해당 오류가 발생했을 때 아래의 경우를 확인해야 한다

 

1. Controller, DAO(Repository), Service에서 각각에 넘겨주는 쿼리값의 주입이 됐는지 확인

controller 안에서 repository와 service 객체를 final로 선언
service 안에서 repository를 final로 선언

 

2. 테이블 정보와 DB가 run 중인지 확인

컬럼값 중에 null이 될 수 있는 경우가 아닐 때 null이 들어가는지 확인
DB 정보도 확인
오류 없이 제대로 실행된다!

 

728x90
반응형