반응형
Spring boot 실행시 아래와 같은 에러가 나왔다.
2020-12-08 23:12:31.312 ERROR 256300 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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).
반응형
아래와 같이 jdbc dependency를 추가한 상태에서 dataSource를 설정해주지 않아서 발생한 것이었음.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
db구축이 되어있지 않다면 위 dependency를 제거하고,
db구축이 되어있다면 아래와 같이 application.properties에 DB 설정 정보를 추가하면 해결된다.
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver spring.datasource.url=jdbc:oracle:thin:@localhost:1521/xe spring.datasource.username=admin spring.datasource.password=1234
반응형