세라공원

[spring] jUnit , OracleDB 연결 에러 본문

Error

[spring] jUnit , OracleDB 연결 에러

세라박 2022. 5. 12. 18:50

java.lang.IllegalStateException: Failed to load ApplicationContext

ERROR: org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@598067a5] to prepare test instance [com.community.sera.ReplyMapperTest@2101b44a]
java.lang.IllegalStateException: Failed to load ApplicationContext

해결 방식

1) @WebAppConfiguration 주석 추가 -> 실패

2) 서비스에서 Oracle DB 연결되어있는지 확인 -> 연결 되어있었음. 원인이 아님.

3) rootContext.xml 확인 -> mybatis에 spring과 연동하는 방식이 주석으로 막혀 있었음. -> 해결.

 

해결 : rootContext에 주석으로 막혀 있었음.

<!-- mybatis에 spring과 연동하는 방식을 적용할 때 필요 -->
<mybatis-spring:scan base-package="경로"/>

 

Comments