尝试针对我的prod数据库运行时,我收到了java.lang.NullPointerException错误。适用于我的测试数据库。
我升级到3.3.5,仍然是同样的问题。
任何指针?
下面的调试输出。
DEBUG 3/06/15 10:18 PM: liquibase: Connected to *******@******@jdbc:mysql://**********.hostedresource.com:3306/******
DEBUG 3/06/15 10:18 PM: liquibase: Setting auto commit to false from true
DEBUG 3/06/15 10:18 PM: liquibase: Computed checksum for 1433333922425 as 4718a9188c6a346602e81ac36af75247
DEBUG 3/06/15 10:18 PM: liquibase: Executing QUERY database command: select count(*) from skidreamzprd.DATABASECHANGELOGLOCK
DEBUG 3/06/15 10:18 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM skidreamzprd.DATABASECHANGELOGLOCK WHERE ID=1
DEBUG 3/06/15 10:18 PM: liquibase: Lock Database
DEBUG 3/06/15 10:18 PM: liquibase: Executing UPDATE database command: UPDATE skidreamzprd.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'fe80:0:0:0:604c:c4ff:fe02:18f3%awdl0 (fe80:0:0:0:604c:c4ff:fe02:18f3%awdl0)', LOCKGRANTED = '2015-06-03 22:18:42.983' WHERE ID = 1 AND LOCKED = 0
INFO 3/06/15 10:18 PM: liquibase: Successfully acquired change log lock
DEBUG 3/06/15 10:18 PM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd'
DEBUG 3/06/15 10:18 PM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd'
DEBUG 3/06/15 10:18 PM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd'
DEBUG 3/06/15 10:18 PM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd'
DEBUG 3/06/15 10:18 PM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-3.1.xsd
DEBUG 3/06/15 10:18 PM: liquibase: Release Database Lock
DEBUG 3/06/15 10:18 PM: liquibase: Executing UPDATE database command: UPDATE skidreamzprd.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 3/06/15 10:18 PM: liquibase: Successfully released change log lock
Unexpected error running Liquibase: Unknown Reason
SEVERE 3/06/15 10:18 PM: liquibase: Unknown Reason
java.lang.NullPointerException
at liquibase.changelog.StandardChangeLogHistoryService.init(StandardChangeLogHistoryService.java:103)
at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:786)
at liquibase.Liquibase.update(Liquibase.java:194)
at liquibase.integration.commandline.Main.doMigration(Main.java:1044)
at liquibase.integration.commandline.Main.run(Main.java:175)
at liquibase.integration.commandline.Main.main(Main.java:94)
For more information, use the --logLevel flag
答案 0 :(得分:2)
在@Jens的帮助下,我们跟踪此异常是由prod db中的VIEW损坏引起的。与DATABASECHANGELOG无关。修复视图然后允许liquibase正常运行。在这种情况下,liquibase易受现有应用程序数据库的稳定性影响。
答案 1 :(得分:0)
回答可能有点迟了,但我们遇到了同样的问题。原因是,正如我们已经想到的那样,我们已经将MySQL实例从5.6.2x更新到5.6.7x,从那时起,表和列名称不再处理不区分大小写了。在类StandardChangeLogHistoryService中,liquibase尝试从DATABASECHANGELOG表中获取列“LIQUIBASE”(以大写字母表示),并失败。虽然它不是一个完美的解决方案,但我们通过在确保--lower-case-table-names=1
中设置属性my.cnf
后重新创建特定数据库来解决问题。