【发布时间】:2011-02-11 01:30:59
【问题描述】:
我正在使用 Grails,并且我有一个本地插件(我编写的),我将它与我的项目结合使用。本地插件位置在 BuildConfig.groovy 中使用 grails.plugin.location 配置参数进行配置。
在 Grails 1.3.3 中,该插件运行良好,但是自从升级到 Grails 1.3.5 后,当我尝试运行插件的脚本之一时出现以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager': Invocation of init method failed; nested exception is java.io.FileNotFoundException: web-app\WEB-INF\grails.xml (The system cannot find the file specified)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
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.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:590)
at gant.Gant.executeTargets(Gant.groovy:589)
我相信 grails.xml 文件(它声称丢失)是自动生成的 - 问题可能与问题 GRAILS-6601 有关(但是,这已在 1.3.5 中修复)。
无论如何,我的问题似乎是由于 Grails 1.3.3 和 1.3.5 之间的 _GrailsBootstrap.groovy 脚本发生了变化。比较 1.3.3 和 1.3.5 之间的这些脚本,我注意到脚本的新 pluginManager 部分显示:
// There is a pluginManager variable in the binding
delegate."pluginManager"(GrailsPluginManagerFactoryBean) {
application = grailsApplication
grailsDescriptor = new FileSystemResource("web-app/WEB-INF/grails.xml")
}
这在 Grails 1.3.3 中的等效脚本中不存在,似乎是导致我的问题的原因。我查看了发行说明和其他信息,但无法找到是否需要配置新内容才能使本地插件正常工作。
有什么办法可以避免这个错误吗?是否是配置问题,如果是,我缺少什么?
【问题讨论】:
-
您是否尝试过重新安装插件?
标签: grails grails-plugin