본문 바로가기
ETC/Errors

[Error] java.lang.IllegalStateException: Failed to load ApplicationContext 에러

by lewns2 2021. 3. 11.

상황 : Spring jUnit(JPA 테스트 코드) 테스트에서 아래와 같은 에러 발생

java.lang.IllegalStateException: Failed to load ApplicationContext

Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
...

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
...

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
...

 

해결 : build.gradle 에서 H2 데이터베이스 의존성 재설치 

 

클래스 어노테이션의 문제인 줄 알았으나, 그냥 gradle 설치가 제대로 안되었던 걸로...^^;;

728x90
반응형