我遇到了一个问题的幽灵。它偶尔发生。它与更改后重新加载控制器有关。大多数时候,我可以通过还原更改并重新开始来解决问题,但是我目前仍处于困境。以下是堆栈跟踪。
File /Users/mcroteau/Development/projects/greenfield/grails-app/controllers/greenfield/DataController.groovy changed, recompiling...
2019-01-07 20:05:32.374 ERROR --- [ Thread-7] o.g.plugins.AbstractGrailsPluginManager : Plugin [controllers:3.3.9] could not reload changes to file [/Users/mcroteau/Development/projects/greenfield/grails-app/controllers/greenfield/DataController.groovy]: No signature of method: grails.core.DefaultGrailsApplication.isArtefactOfType() is applicable for argument types: (java.lang.String, org.springframework.core.io.FileSystemResource) values: [TagLib, file [/Users/mcroteau/Development/projects/greenfield/grails-app/controllers/greenfield/DataController.groovy]]
Possible solutions: isArtefactOfType(java.lang.String, java.lang.Class), isArtefactOfType(java.lang.String, java.lang.String)
groovy.lang.MissingMethodException: No signature of method: grails.core.DefaultGrailsApplication.isArtefactOfType() is applicable for argument types: (java.lang.String, org.springframework.core.io.FileSystemResource) values: [TagLib, file [/Users/mcroteau/Development/projects/greenfield/grails-app/controllers/greenfield/DataController.groovy]]
Possible solutions: isArtefactOfType(java.lang.String, java.lang.Class), isArtefactOfType(java.lang.String, java.lang.String)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:71)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at org.grails.plugins.web.GroovyPagesGrailsPlugin.onChange(GroovyPagesGrailsPlugin.groovy:305)
at org.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:750)
at grails.plugins.DefaultGrailsPluginManager.informObservers(DefaultGrailsPluginManager.java:210)
at org.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:774)
at org.grails.plugins.AbstractGrailsPluginManager.informOfClassChange(AbstractGrailsPluginManager.java:548)
at org.grails.plugins.AbstractGrailsPluginManager.informOfFileChange(AbstractGrailsPluginManager.java:488)
at grails.plugins.GrailsPluginManager$informOfFileChange$2.call(Unknown Source)
at grails.boot.GrailsApp$_enableDevelopmentModeWatch_closure1.doCall(GrailsApp.groovy:250)
at grails.boot.GrailsApp$_enableDevelopmentModeWatch_closure1.doCall(GrailsApp.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1427)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.run(Closure.java:499)
at java.lang.Thread.run(Thread.java:748)
这是它当前正在发生的一个项目:https://github.com/opengreenfield/greenfield-分支国际化,DataController。我可以删除内容。
提前感谢您的帮助!
答案 0 :(得分:1)
我看到您的软件包定义和文件夹结构不匹配。我猜这会让grails感到困惑。尝试将它们排列起来。