2013-08-19 54 views
0

我正在使用Grails database migration pluginGrails數據庫遷移失敗,併發生LiquibaseException

這是我的配置:

grails.plugin.databasemigration.updateOnStart = true 
grails.plugin.databasemigration.updateOnStartFileNames = 'changelog.groovy' 

當我開始我的應用程序我得到這個異常:

| Error 2013-08-20 08:55:47,356 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: liquibase.exception.LiquibaseException: Cannot find parser that supports c 
Message: liquibase.exception.LiquibaseException: Cannot find parser that supports c 
    Line | Method 
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 166 | run  in java.util.concurrent.FutureTask 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run . . . in java.lang.Thread 

Caused by LiquibaseException: Cannot find parser that supports c 
->> 61 | getParser in liquibase.parser.ChangeLogParserFactory 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 623 | listUnrunChangeSets in liquibase.Liquibase 
|  67 | doCall . in grails.plugin.databasemigration.MigrationRunner$_autoRun_closure1 
| 132 | executeInSession in grails.plugin.databasemigration.MigrationUtils 
|  56 | autoRun . in grails.plugin.databasemigration.MigrationRunner 
|  96 | doCall in DatabaseMigrationGrailsPlugin$_closure2 
| 334 | innerRun in java.util.concurrent.FutureTask$Sync 
| 166 | run  in java.util.concurrent.FutureTask 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run . . . in java.lang.Thread 

任何想法,爲什麼?

回答

3

的問題是,updateOnStartFileNames屬性接受一個數組,而不是字符串,所以配置應該是

grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy'] 

在這個列表執行每個反過來插件迭代,但是當給定的字符串,遍歷每個角色並執行它。然後Liquibase拋出異常,因爲它不識別第一個字母的後綴,在這種情況下,'c'。