쩨이엠 개발 블로그

[ Spring ] Failed to determine a suitable driver class 본문

개발/Spring

[ Spring ] Failed to determine a suitable driver class

쩨이엠 2020. 6. 29. 14:42
728x90
반응형

 

오랜만에 보는 스타트 실패 로그 ㅎㅎㅎㅎ

 

***************************
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).

 

DB가 정의가 되지 않았다는 말인데

원래라면 driver class를 application.properties에 추가해주면 되겠지만 내 경우는 DB가 필요가 없었다

 

그럴 때 해 줄수 있는 어노테이션

원래의 SpringBootApplication 어노테이션 옆에 exclude = DataSourceAutoConfiguration.class 를 추가해준다

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class Application {
   
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

}

 

 

728x90
반응형
Comments