【发布时间】:2020-12-19 20:48:16
【问题描述】:
我尝试将我的应用部署到 Heroku。我可以看到日志有如下异常:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.flywaydb.core.api.FlywayException: Unable to autodetect JDBC driver for url: jdbc:postgres://hostname:5432/databaseName.
我知道为什么我有这个例外,因为 jdbc:postgres://... 在 url。 Flyway 期望这样的 url:jdbc:postgresql://.... 来定义驱动程序。但是 Heroku 提供的数据库 url 没有后缀 ql。我该如何解决?
【问题讨论】:
标签: spring spring-boot heroku flyway heroku-postgres