[英]Error in eclipse project grails/groovy
I have the following error when working with grails project in eclipse 在Eclipse中使用Grails项目时出现以下错误
An internal error occurred during: "Requesting Java AST from selection".
在以下过程中发生内部错误:“从选择中请求Java AST”。 org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler.(Lorg/codehaus/groovy/eclipse/core/model/GroovyProjectFacade;)V
org.codehaus.groovy.eclipse.core.compiler.GroovySnippetCompiler。(Lorg / codehaus / groovy / eclipse / core / model / GroovyProjectFacade;)V
Anybody have the same problem? 有人有同样的问题吗?
How fix the problem? 如何解决问题?
Update : 更新 :
The issue was fixed in the latest Snapshot releases of Groovy Eclipse 2.9.3 so you may now just follow the guide @ https://technology.first8.nl/eclipse-neon-grails-2-x-with-groovy-and-gsp-support/ 该问题已在Groovy Eclipse 2.9.3的最新Snapshot版本中修复,因此您现在可以按照指南@ https://technology.first8.nl/eclipse-neon-grails-2-x-with-groovy-and- gsp-support /
Previous answer : 先前的答案 :
I also stumbled across this error and it happens only in classes that are grails-artefacts (services, controllers, ...). 我还偶然发现了此错误,它仅在grails-artefacts(服务,控制器等)的类中发生。 It seems to be related to recent changes in grails-eclipse plugin 2.9.2.
它似乎与grails-eclipse插件2.9.2的最新更改有关。 A version from june 2017 worked without any issues and a recent upgrade to 2.9.2 release from january 2018 brought up the issue.
2017年6月的一个版本没有任何问题,最近从2018年1月升级到2.9.2版本提出了此问题。
I fixed the issue by using the groovy-eclipse 2.9.2 version from 2015 which is contained in the GGTS update-site 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 ). 我使用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 )。
What I was searching for (without success) was an archive of release versions of the groovy-eclipse 2.9.2 branch. 我要寻找的(没有成功的)是groovy-eclipse 2.9.2分支的发行版本的存档。 This way I would at least have the option to install the working 2.9.2 version from june 2017... If anyone has a clue where to find older versions I would be happy for a hint!
这样,我至少可以选择从2017年6月开始安装可运行的2.9.2版本。如果有人知道在哪里可以找到较旧的版本,我很乐意提供提示!
The stacktrace of the initially mentioned Exception looks like that: 最初提到的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.