스프링 부트 프로젝트를 실행하는데 다음과 같은 에러가 나타났다.
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1

오류내용을 읽어보니 Spring Boot 애플리케이션이 데이터베이스 관련 설정을 찾지 못해서 발생하는 것으로 보인다.
나의 경우는 새로 만든 프로젝트에서 DB에대한 설정을 아무것도 해주지 않았다.
따라서 build.gradle 파일에서 아래와 같이 db에 대한 의존성을 추가해주었더니 해결되었다.
dependencies {
implementation 'com.h2database:h2' // H2 Database
}
'Programing > Spring Boot' 카테고리의 다른 글
| Spring Boot 다국어(i18n) 처리 및 MessageSource 활용 (0) | 2023.12.26 |
|---|---|
| 안드로이드 notification 뱃지 제거하기, 카운트 수정하기 (0) | 2023.11.25 |
| 동시성 문제 해결 - 비관적 락 (Pessimistic Lock) (0) | 2023.08.03 |
| 코틀린 Querydsl Pageble Sort 동적 정렬 쉽게 사용하기 + 유틸화 (0) | 2023.07.13 |
| 스프링부트 스케줄러가 여러번 실행된다면? @SchedulerLock 사용법 (0) | 2023.07.06 |