Liquibase generateChangeLog MissingObjectChangeGenerator

时间:2017-09-14 14:39:55

标签: java liquibase

我正在使用Liquibase并尝试使用命令liquibase generateChangeLog。 我正在使用正确的连接器和凭据。在从所有表中捕获信息之后,调试跟踪在结尾处显示此错误。

DEBUG 14/09/17 16.30: liquibase: MissingObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.Index    liquibase.structure.core.ForeignKey    liquibase.structure.core.View
Unexpected error running Liquibase: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

SEVERE 14/09/17 16.30: liquibase: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:265)
        at liquibase.integration.commandline.Main.doMigration(Main.java:1011)
        at liquibase.integration.commandline.Main.run(Main.java:188)
        at liquibase.integration.commandline.Main.main(Main.java:103)
Caused by: liquibase.command.CommandExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)
        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:263)
        ... 3 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at liquibase.change.ColumnConfig.<init>(ColumnConfig.java:119)
        at liquibase.change.AddColumnConfig.<init>(AddColumnConfig.java:16)
        at liquibase.diff.output.changelog.core.MissingIndexChangeGenerator.fixMissing(MissingIndexChangeGenerator.java:63)
        at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:47)
        at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:99)
        at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:193)
        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:147)
        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:88)
        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:75)
        at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:54)
        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
        ... 4 more

1 个答案:

答案 0 :(得分:0)

最后我终于找到了解决方案。

存在以下问题:

  1. 名称以空格分隔的列。
  2. 没有主键的表。
  3. 主键索引。
  4. 因此,消除空格,提供PK并删除无用的索引,错误消失了,我可以继续。

    非常感谢。