1
我正在使用數據庫遷移:2.0.0.RC1和Grails 3.0.7。我遇到了遷移問題。當我啓動時出現以下錯誤:Grails 3數據庫遷移問題
Caused by: java.lang.IllegalArgumentException: Script text to compile cannot be null!
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at groovy.lang.GroovyClassLoader.validate(GroovyClassLoader.java:315) ~[groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:275) ~[groovy-2.4.4.jar:2.4.4]
at org.grails.plugins.databasemigration.liquibase.GroovyChangeLogParser.parseToNode(GroovyChangeLogParser.groovy:74)
at groovy.lan at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:17)
g.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) ~[groovy-2.4.4.jar:2.4.4]
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694) ~[groovy-2.4.4.jar:2.4.4]
at groovy.lang.GroovyShell.parse(GroovyShell.java:706) ~[groovy-2.4.4.jar:2.4.4]
at liquibase.Liquibase.update(Liquibase.java:192)
at groovy.lang.GroovyShell.parse(GroovyShell.java:742) ~[groovy-2.4.4.jar:2.4.4]
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:353)
at groovy.lang.GroovyShell.parse(GroovyShell.java:733) ~[groovy-2.4.4.jar:2.4.4]
at org.grails.plugins.databasemigration.liquibase.GrailsLiquibase.performUpdate(GrailsLiquibase.groovy:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:317)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426) ~[springloaded-1.2.4.RELEASE.jar:1.2.4.RELEASE]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169) ~[groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71) ~[groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) [groovy-2.4.4.jar:2.4.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.grails.plugins.databasemigration.liquibase.GroovyChangeLogParser.parseToNode(GroovyChangeLogParser.groovy:63) ~[database-migration-2.0.0.RC1.jar:na]
... 28 common frames omitted
問題似乎是找不到changelog.groovy文件。我調試的GroovyChangeLogParser內,並在這條線失敗:
inputStream = StreamUtil.singleInputStream(physicalChangeLogLocation, resourceAccessor)
如果我檢查resourceAccessor,它並沒有在它的grails-app /遷移的文件夾,所以無法找到changelog.groovy文件。我不確定該從哪裏出發。我錯過了一些配置或者什麼?我有這個插件在Grails 2.3.7項目中工作正常。
啊,是啊,就是這樣。我正在從舊版本的自述文件中刪除,並沒有意識到有一個新的,添加的配置步驟。 – cloudwalker