Eclipse hangs when creating a new Groovy class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Eclipse hangs when creating a new Groovy class

Volker Leidl
Hi,

I've encountered the following problem with the Groovy-Eclipse plugin. I'm trying to create a new Groovy class. I get to the dialogue where I can enter the class name, but when clicking the Finish button, Eclipse goes off and never completes. I've waited for more than half an hour to see if it ever finishes, but no luck. It uses up a fair amount of CPU time for this (about 25%), so it doesn't just sit there idly. From looking at various stack dumps, it appears that some threads are stuck in some form of dependency processing. Here's a stack trace:

"Worker-92" prio=6 tid=0x000000001061f800 nid=0x2ae4 runnable [0x000000001cf6e000]
   java.lang.Thread.State: RUNNABLE
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:318)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.computeDependenciesFromProject(CompilerUtils.java:312)
at org.eclipse.jdt.core.util.CompilerUtils.calculateClasspath(CompilerUtils.java:248)
at org.eclipse.jdt.core.util.CompilerUtils.setGroovyClasspath(CompilerUtils.java:152)
at org.eclipse.jdt.core.util.CompilerUtils.setGroovyClasspath(CompilerUtils.java:117)
at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.buildStructure(GroovyCompilationUnit.java:266)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:526)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:255)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:241)
at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:196)
at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType(JavaElement.java:210)
at org.eclipse.jdt.internal.core.CompilationUnit.getTypes(CompilationUnit.java:933)
at org.springframework.ide.eclipse.data.beans.ui.model.RepositoriesModelLabelDecorator.decorateJavaElement(RepositoriesModelLabelDecorator.java:60)
at org.springframework.ide.eclipse.data.beans.ui.model.RepositoriesModelLabelDecorator.decorate(RepositoriesModelLabelDecorator.java:35)
at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


I'm using Juno 64bit on Windows 7 with version 2.8.0.xx-20130703-1700-e42-RELEASE of the Groovy-Eclipse plugin. I've tried Kepler too, but it's the same problem. I've got about 180 projects in my workspace, which are connected in a fairly deep dependency graph. Only one project includes the Groovy nature, though. This is the first time I've tried the Groovy-Eclipse plugin with this project, so I can't say if it would've worked with an older version. It seems to work fine when I only have a single project in my workspace. I'm getting essentially the same problem on project import and when trying to open an existing Groovy file. 

Has anyone else used the plugin with a comparable workspace size? Are there any settings I can try and change?

Thanks,
Volker
Reply | Threaded
Open this post in threaded view
|

Re: Eclipse hangs when creating a new Groovy class

tomasisonfire
This post has NOT been accepted by the mailing list yet.
Hello Volker,

I've had a similar experience with groovy-eclipse plugin under eclipse Kepler on Windows 7 64bit. I've got around 140 projects in my workspace and no trouble at all when editing java files. Groovy, however, makes eclipse unresponsive.

I've taken some time analyzing thread dumps from eclipse and I found that org.eclipse.jdt.core.util.CompilerUtils.setGroovyClasspath() is really causing trouble. After checking out the source at (ftp://ftp.university.kg/pub/java/ide/eclipse/plugins/trunk/base/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/CompilerUtils.java), I tested including a blank file names "groovy.properties" in the root of the project I was editing and just like magic it started working again.

I hope this really simple solution works for you as well.

Good luck,
Tomás