Reputation: 2466
I'm using the database-migration:2.0.0.RC1 with Grails 3.0.7. I'm having an issue getting the migrations to run. When I start up I get the following error:
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
The issue seems to be that the changelog.groovy file cannot be found. I debugged inside of the GroovyChangeLogParser, and it fails on this line:
inputStream = StreamUtil.singleInputStream(physicalChangeLogLocation, resourceAccessor)
If I inspect the resourceAccessor, it does not have the grails-app/migrations folder in it, so it fails to find the changelog.groovy file. I'm not sure where to go from here. Am I missing some configuration or something? I have this plugin working fine in a Grails 2.3.7 project.
Upvotes: 1
Views: 862
Reputation: 515
seems like your missing the gradle config mentioned in the readme:
https://github.com/yamkazu/database-migration
sourceSets {
main {
resources {
srcDir 'grails-app/migrations'
}
}
}
Upvotes: 5