繁体   English   中英

Eclipse项目Grails / Groovy中的错误

[英]Error in eclipse project grails/groovy

在Eclipse中使用Grails项目时出现以下错误

在以下过程中发生内部错误:“从选择中请求Java AST”。 org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler。(Lorg / codehaus / groovy / eclipse / core / model / GroovyProjectFacade;)V

有人有同样的问题吗?

如何解决问题?

更新

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

先前的答案

我还偶然发现了此错误,它仅在grails-artefacts(服务,控制器等)的类中发生。 它似乎与grails-eclipse插件2.9.2的最新更改有关。 2017年6月的一个版本没有任何问题,最近从2018年1月升级到2.9.2版本提出了此问题。

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

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

最初提到的Exception的stacktrace如下所示:

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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM