spring-boot - Spring Boot问题中的Flyway集成(企业版)
问题描述
您好,当我在 springboot 项目中使用 flyway Enterprise 时出现此错误:
16:27:46 WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springAsyncConfig': Unsatisfied dependency expressed through field 'customAsyncExceptionHandler'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customAsyncExceptionHandler': Unsatisfied dependency expressed through field 'importHistoryRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'importHistoryRepository': Cannot create inner bean '(inner bean)#31db34da' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#31db34da': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration': Unexpected exception during bean creation; nested exception is java.lang.TypeNotPresentException: Type org.flywaydb.core.api.callback.FlywayCallback not present
这是我的 pom.xml 文件:
<dependency>
<groupId>org.flywaydb.enterprise</groupId>
<artifactId>flyway-core</artifactId>
<version>6.0.3</version>
</dependency>
解决方案
与此问题相关Flyway 6.xx 与 Spring Boot < 2.2.0 不兼容。
所以你有2个选择:
- 将 Spring Boot 更新为 >= 2.2.0
- 使用flyway 5.xx
希望这可以帮助
推荐阅读
- c++ - 编译适用于大多数 Windows 操作系统版本的 pybind11 python 模块
- javascript - 在按钮单击时对 vuetify 简单表进行排序
- r - 如何在 R 中将 8GB WAVE 文件(持续 24 小时)拆分为更小的文件(持续 1 小时)?
- reactjs - 将按钮 ID 设置为单击时的状态
- swift - 简单的编辑画面
- jenkins-pipeline - 无法将 X 射线报告导入 Jira
- wordpress - IBM Watson Assistant:使用新生成的 API 详细信息仍会在我的 Wordpress 站点上部署旧助手
- javascript - React - 使用 usestate 钩子推送数组
- python - 获取将值添加到列表中的所有可能结果
- mysql - 更新到 8.0.22 后 MySQL 服务器 InnoDB posix_fallocate() 错误