I am attempting to add an environment to a Grails 2.4.4 app, as documented: http://docs.grails.org/2.4.4/guide/conf.html#environments
I have added configuration for this environment to all of
Config.groovy, DataSource.groovy, and BootStrap.groovy as documented.
However, when I attempt to execute my unit tests in this environment with the command grails -Dgrails.env=shippable test-app --unit --stacktrace, I receive an exception that I am unable to find a cause for:
| Compiling 16 source files.
| Error Error executing script TestApp: java.lang.NullPointerException: Cannot invoke method newInstance() on null object (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException: Cannot invoke method newInstance() on null object
at _Events$_run_closure2_closure7.doCall(_Events.groovy:24)
at _Events$_run_closure2.doCall(_Events.groovy:22)
at _Events$_run_closure2.doCall(_Events.groovy)
at _Events$_run_closure4.doCall(_Events.groovy:33)
at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
at org.codehaus.gant.GantBinding$_withTargetEvent_closure1.doCall(GantBinding.groovy:89)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:89)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at TestApp$_run_closure1.doCall(TestApp.groovy:32)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
| Error Error executing script TestApp: java.lang.NullPointerException: Cannot invoke method newInstance() on null object
Lines 18-28 of _Events.groovy are shown here:
Closure installBowerNotification = {
event 'StatusError', [
"Failed to install front-end javascript dependencies. " +
"If you're not working on the CMS, it's safe to ignore " +
"this message. "
]
event 'StatusError', [
'Please install Yarn and Bower as described in the README. ' +
'(i.e., `brew install yarn && yarn global add bower`)'
]