티스토리 뷰
728x90
간단하게 요청테스트만 해보려고 했는데 아래와 같은 에러 발생
사실 요청 테스트는 TEST 코드로 확인할 수도 있지만 잘 몰라서...공부 필요
어쨌든 오류 이유는 스프링부트에서 컨테이너가 최초 기동될 때 자동으로 autoconfigure 파일들을 읽는데 DB의 url이나 id, password, drive-class-name 같은게 설정이 안되있어서 그렇다.
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).
가장 간단하게 해결할 수 있는 방법은 최초 구동 시 DataSourceAutoConfiguration 를 제외 시켜주면 된다.
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class SampleApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Spring
- mybatis
- Bash tab
- mybatis config
- oracle
- Mac
- Spring Security
- JavaScript
- svn
- maven
- Github Status
- LocalDateTime
- Java
- window
- LocalDate
- docker
- 베리 심플
- 오라클
- Kotlin
- localtime
- elasticsearch
- springboot
- input
- config-location
- k8s
- jQuery
- Linux
- intellij
- 북리뷰
- rocky
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함