我通过 grails 控制台而不是 BootStrap 执行以下代码:
class BootStrap {
def fixtureLoader
def init = { servletContext ->
fixtureLoader.load("MockRecords")
}
}
我收到以下错误:
java.lang.NullPointerException: Cannot invoke method load() on null object
at Script1.run(Script1.groovy:16)
at org.grails.plugins.console.ConsoleService.eval(ConsoleService.groovy:57)
at org.grails.plugins.console.ConsoleService.eval(ConsoleService.groovy:37)
at org.grails.plugins.console.ConsoleController$_closure2.doCall(ConsoleController.groovy:61)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
undefined
我如何使用控制台加载固定装置