application.properties

yedi·2024년 5월 3일
post-thumbnail

Spring Boot App 을 실행했더니 아래와 같은 error 가 발견되었다.

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
데이터 소스를 구성하지 못했습니다. 'url' 속성이 지정되지 않았으며 포함된 데이터 소스를 구성할 수 없습니다.
이유: 적합한 드라이버 클래스를 결정하지 못했습니다.

해당 구문은 설정 파일인 application.properties 에 문법이 선언되어 있지 않거나 연결이 제대로 되어있지 않아서 나는 오류이다.


해결 방법

1. src / main / resources / application-local.properties 파일을 만들고, 필요한 문법에 맞게 설정해둔다.

application.propertis 이란

  • application 의 구성 및 환경변수를 설정하는데에 활용
  • database 연결 정보, server port, logging 수준

2. Boot Dashboard -> local -> 해당 project -> Open Config 선택

3. Profile -> local 선택 -> Apply / Debug 실행

4. Project 를 재실행하면 문제없이 실행되는 것을 확인할 수 있다.

0개의 댓글