似乎在grails中的分叉执行比其他任何事情都有更多的愚蠢问题
在GGTS 3.6.3上使用grails 2.4.4,groovy 2.3.7,64bit
尝试修复另一个插件(它已过时,我正在尝试修复)。有问题。将所有内容简化为一个简单的插件和演示项目,其中包含来自本地工作区的插件
在DemoProject中的我在buildConfig.groovy中做了这样的插件的本地包含
grails.plugin.location.DummyPlugin = "../DummyPlugin"
到目前为止一切顺利。无需添加_Events.grooy并运行DemoProject,所有启动都可以正常加载插件。
现在将_Events.groovy添加到plugins / script文件夹中。在该文件中,我将此行放在顶部
import grails.util.BuildSettingsHolder as build
import groovy.xml.MarkupBuilder
includeTargets << grailsScript("_GrailsPackage")
现在当您运行演示项目时,会出现类似
的错误|Running Grails application
Error |
Error loading event script from file [E:\workspace\ggts3.6.2-workspace\DummyPlugin\scripts\_Events.groovy] No such property: classLoader for class: java.lang.Object (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
groovy.lang.MissingPropertyException: No such property: classLoader for class: java.lang.Object
at grails.util.BuildSettings$1.doCall(BuildSettings.groovy:409)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at _Events.run(_Events.groovy:29)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.createEventListener(ForkedTomcatServer.groovy:147)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.createTomcatRunner(ForkedTomcatServer.groovy:104)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.runInternal(ForkedTomcatServer.groovy:82)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.run(ForkedTomcatServer.groovy:66)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer$run.call(Unknown Source)
at org.grails.plugins.tomcat.fork.ForkedTomcatServer.main(ForkedTomcatServer.groovy:60)
Error |
Error loading event script from file [E:\workspace\ggts3.6.2-workspace\DummyPlugin\scripts\_Events.groovy] No such property: classLoader for class: java.lang.Object
|Server running. Browse to http://localhost:8080/DemoDummyProject
如果你回到DemoProject并通过设置grails.project.fork = []停止分叉Execection并再次运行它一切正常 - 没有错误。
所以基本上分叉执行搞砸了插件includeTargets动作。
你如何解决这个问题,而std forked config现在默认启用 - 任何线索?请求建议