eclipse project grails/groovy 中的错误



在 eclipse 中使用 grails 项目时出现以下错误

期间发生内部错误:"从选择中请求 Java AST"。 org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler.(Lorg/codehaus/groovy/eclipse/core/model/GroovyProjectFacade;)五

有人有同样的问题吗?

如何解决问题?

更新

此问题已在 Groovy Eclipse 2.9.3 的最新快照版本中修复,因此您现在可以按照指南@ https://technology.first8.nl/eclipse-neon-grails-2-x-with-groovy-and-gsp-support/

以前的答案

我也偶然发现了这个错误,它只发生在圣杯伪影(服务、控制器等)的类中。这似乎与 grails-eclipse 插件 2.9.2 的最新变化有关。2017 年 6 月的版本没有任何问题,最近从 2.9.2 年 2018 月升级到 2018 年 1 月的版本带来了这个问题。

我通过使用 2015 年的 groovy-eclipse 2.9.2 版本解决了这个问题,该版本包含在 GGTS 更新站点 zip (http://download.springsource.com/release/TOOLS/update/3.6.4.RELEASE/e4.5/springsource-tool-suite-3.6.4.RELEASE-e4.5-updatesite.zip) 中。

我正在寻找(没有成功)是 groovy-eclipse 2.9.2 分支的发布版本的存档。这样,我至少可以选择从2.9.2月开始安装2017的工作版本...如果有人知道在哪里可以找到旧版本,我很乐意提供提示!

最初提到的异常的堆栈跟踪如下所示:

java.lang.NoSuchMethodError: org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler.<init>(Lorg/codehaus/groovy/eclipse/core/model/GroovyProjectFacade;)V
at org.grails.ide.eclipse.editor.groovy.types.PerProjectTypeCache.setProject(PerProjectTypeCache.java:107)
at org.grails.ide.eclipse.core.internal.plugins.GrailsCore$PerProjectCacheManager.get(GrailsCore.java:54)
at org.grails.ide.eclipse.core.internal.plugins.GrailsCore.connect(GrailsCore.java:199)
at org.grails.ide.eclipse.editor.groovy.elements.GrailsProject.findAllServices(GrailsProject.java:510)
at org.grails.ide.eclipse.editor.groovy.types.PerProjectServiceCache.ensureInitialized(PerProjectServiceCache.java:108)
at org.grails.ide.eclipse.editor.groovy.types.PerProjectServiceCache.findServicesFor(PerProjectServiceCache.java:93)
at org.grails.ide.eclipse.editor.groovy.elements.AbstractGrailsElement.populateInjectedServices(AbstractGrailsElement.java:148)
at org.grails.ide.eclipse.editor.groovy.elements.ControllerClass.initializeTypeLookup(ControllerClass.java:284)
at org.grails.ide.eclipse.editor.groovy.types.GrailsTypeLookup.initialize(GrailsTypeLookup.java:100)
at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:347)
at org.codehaus.groovy.eclipse.codebrowsing.requestor.CodeSelectHelper.selectASTNode(CodeSelectHelper.java:126)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.initialize(GroovyOccurrencesFinder.java:181)
at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.findOccurrences(GroovyOccurrencesFinder.java:209)
at org.codehaus.groovy.eclipse.editor.GroovyEditor.updateOccurrenceAnnotations(GroovyEditor.java:1317)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3380)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:178)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

最新更新