Context initialization failed

roon2020·2021년 2월 21일
0

spring

목록 보기
4/16
post-thumbnail

오류

테스트 코드는 다 정상 작동하는데 톰캣 서버를 이용해서 프로젝트를 실행하고 특정 주소로 접근했는데 오류가 발생했습니다.

ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in com.roon.config.RootConfig
...
심각: Context initialized 이벤트를 [org.springframework.web.context.ContextLoaderListener] 클래스의 인스턴스인 리스너에 전송하는 동안 예외 발생
...

오류 이전에 [Warn]도 발생했습니다.

WARN : org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Exception encountered during context initialization

해결

오류메시지 이전에 이 경고가 근본적인 문제일 거라 생각했습니다.
Web configuration에 문제가 있다고 말하는 것 같았습니다.
원인은 ojdbc8.jar이 [Web Deployment Assembly]에 추가되지 않았던 것이었습니다.
[Build Path]에는 추가해줬는데 프로젝트를 새로 만들다 보니 깜빡했었던 것 같습니다.
책에도 테스트는 잘 되는데 tomcat 실행 시에 오류가 발생하면 이 부분을 확인하라고 나와있습니다..

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

0개의 댓글