spring - 如何调试卡住的迁移
问题描述
我正在开发一个带有遗留 grails 堆栈的项目,并且在启动应用程序时遇到问题,它在特定迁移时失败
grails dbm-status
在特定迁移中对我来说失败了(我认为?)
| Error Error executing script DbmUpdate:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsApplication':
Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.codehaus.groovy.grails.commons.DefaultGrailsApplication]:
Constructor threw exception;
nested exception is org.codehaus.groovy.grails.exceptions.GrailsConfigurationException:
Class not found loading Grails application: v0212.changelog
(Use --stacktrace to see the full trace)
所以我认为顶部只是“失败的东西”,具体是v0212.changelog
找不到命名的迁移。但是迁移是在我的项目中,并且与我可以看到的所有其他迁移相同。
我还能做些什么来解决这个问题?- 如何找到“当前”迁移 - 如何启动 grails 而不是尝试运行所有迁移?
FWIWgrails console
也因同样的错误而失败。
我尝试删除其他一些迁移,该应用程序将在下一个迁移中失败。我尝试删除整个迁移文件夹,但不知何故它仍然无法找到相同的文件。
▶ grails --version
Grails version: 2.5.6
▶ java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
▶ mysql --version
mysql Ver 14.14 Distrib 5.6.47, for osx10.15 (x86_64) using EditLine wrapper
解决方案
Grails 迁移插件将databasechangelog
在数据库中创建表。您可以通过执行以下命令简单地查询表以检查上次执行的迁移脚本:
select * from databasechangelog
order by orderexecuted desc;
推荐阅读
- gatsby - 将 Gatsby 代码转换为传统的 HTML/CSS/JS 文件?
- javascript - 为什么 let 在 async for 循环中工作而 var 不工作?
- java - Spring @Cacheable 除非由自定义键生成器创建的属性引用键
- python - Python 函数不运行
- python - ValueError:零大小数组到使用 fastai 没有标识的归约操作最大值
- binary-search - 运行此程序时出现 SIGSTOP 错误。为什么是这样?
- linux - svn --set-depth 仍然更新设置为“空”的目录
- c++ - 将数组划分为 k 个非空非相交子段,使得每个子段具有奇数和
- sql - 多列 * 和 * 值的 IN 子句
- azure-active-directory - REDIRECT URI 不匹配失败