h2 연동 에러들
에러문구
Caused by: java.lang.RuntimeException: Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl,
해결
application.yml 또는 .properties 에 분명 오타 또는 띄어쓰기 잘못된거 있으니까 잘 보면 된다..
정말 삽질을 오래했는데 알고봤더니 jdbc 에서 j가 빠져있었다..
spring:
datasource:
url: jdbc:h2:tcp://localhost/~/vintage-camera-shop
에러문구 : h2 DB가 제대로 연결이 안됐다?
java.lang.ClassNotFoundException: org.h2.Driver
해결
build.gradle 에 runtimeOnly 'com.h2database:h2' 추가하면 된다!
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
runtimeOnly('org.springframework.boot:spring-boot-devtools')
runtimeOnly 'com.h2database:h2'
}
반응형
LIST
'에러' 카테고리의 다른 글
이클립스 incompatible jvm 에러해결 방법 (0) | 2023.10.25 |
---|---|
h2 라이브러리 사용 + 이클립스 실행시 에러 (0) | 2023.09.22 |
이클립스 프로젝트 생성할 때 발생한 에러 해결 (0) | 2023.07.24 |
h2 database 연결 실패 에러 not found, File corrupted while reading record 해결방법 (0) | 2023.07.22 |
Multiple markers at this lin 에러 | ajax 기능이 안될 때 해결법 (0) | 2022.11.07 |