Java/Spring Framework

[Spring Boot] A file path that is implicitly relative to the current working directory is not allowed in the database URL

미래의 개발왕 2016. 12. 25. 13:27
728x90
반응형

Flyway를 사용하기 위해 application.yml을 수정 중,

h2 db의 경로 설정 문제로 다음과 같은 에러가 발생



 A file path that is implicitly relative to the current working directory is not allowed in the database URL



설정 했던 경로는 


spring:

  datasource:

    driverClassName: org.h2.Driver

    url: jdbc:h2:file:/tmp/customer

    username: sa

    password



구글링을 해보니 /로 시작하면 안되고, ~/ ./로 하라고 한다.

~/ 와 ./로 하니 프로젝트 path 바로  하위에 tmp폴더가 생성되고 아래 customer.mv.db가 잘 생성된다.



출처: http://stackoverflow.com/questions/30596150/how-to-use-a-path-relative-to-project-root-to-h2-db-file-configuration-with-play 

반응형