춘식이를 좋아하는 개발자

[Spring] Failed to determine a suitable driver class 에러가 발생할 때 본문

Study/Java

[Spring] Failed to determine a suitable driver class 에러가 발생할 때

NaChoon 2022. 6. 7. 14:23
728x90

원인

Spring Boot 프로젝트를 처음 생성하고 실행할 때 Failed to determine a suitable driver class error가 발생할 때가 있다.

Spring Boot 는 실행할 때 기본 설정들을 자동으로 설정하게 되는데

여기서 파일이 비어있으므로 사용자가 원하는 DB 설정을 하고, 맞는 드라이버와 라이브러리를 설치하고, JDBC를 설정해야 한다.

 

해결 방법

이를 해결하기 위해서는 다음과 같은 어노테이션을 Application에 추가해주면 된다.

@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
728x90