Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when building a Groovy project or changing a Groovy source in it #1087

Closed
mauromol opened this issue Apr 15, 2020 · 13 comments
Closed
Assignees
Labels
Milestone

Comments

@mauromol
Copy link

Recently I started to get an error when I try to clean/build some plain Eclipse Groovy projects or just try to change a Groovy source in them. I was not able to fix it and I can't understand what is wrong. Fortunately, usually those projects are test projects, yet this is annoying and the only workaround I found was to delete those projects and recreate them from scratch.

This is the modal dialog that is shown when I issue a "Clean project" action:
immagine

And this is the what gets printed to the error log:

eclipse.buildId=4.14.0.I20191210-0610
java.version=1.8.0_242
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Command-line arguments:  -data file:/home/mauro/workspace/rolling/DCS-SHOP-trunk/ -os linux -ws gtk -arch x86_64

org.eclipse.core.resources
Error
Wed Apr 15 09:56:40 CEST 2020
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:174)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:115)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.lambda$0(GroovyParser.java:120)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:181)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingParser.dietParse(MultiplexingParser.java:45)
	at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:861)
	at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:404)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:454)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:436)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:410)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:218)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:342)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:80)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:275)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:187)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:151)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:149)
	... 26 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.jdt.groovy.core.util.ReflectionUtils.throwableExecutePrivateMethod(ReflectionUtils.java:117)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.resolveRuntimeClasspathEntry(GroovyClassLoaderFactory.java:204)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:191)
	... 29 more
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)
	at org.eclipse.jdt.internal.launching.DefaultEntryResolver.resolveRuntimeClasspathEntry(DefaultEntryResolver.java:70)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1508)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1444)
	... 35 more

The error seems to suggest there's a problem in the project setup with regards to Groovy libraries, but the "Groovy libraries" classpath container is there (with groovy-2.5.11-indy.jar, groovy-test-2.5.11-indy.jar and ivy-2.4.0.jar), even "Groovy DSL support" container is there (although I don't use DSL support) and, most importantly, I did not manually change anything on that project that may justify some kind of project "corruption".

@eric-milles
Copy link
Member

GroovyClassLoaderFactory scans your project(s) and assembles the classpath so that the Groovy compiler can do its thing.

    private static void calculateClasspath(IJavaProject javaProject, Set<String> classPaths, Set<String> xformPaths) {
        try {
            // TODO: Leverage "excludeTestCode" parameter?  http://www.eclipse.org/eclipse/news/4.8/M5/index.html#jdt-test-sources
            IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedRuntimeClasspath(javaProject);
            Arrays.sort(entries, Comparator.comparing(IRuntimeClasspathEntry::getType));
            for (IRuntimeClasspathEntry unresolved : entries) {
                Set<String> paths = (unresolved.getType() == IRuntimeClasspathEntry.CONTAINER ? classPaths : xformPaths);
                for (IRuntimeClasspathEntry resolved : resolveRuntimeClasspathEntry(unresolved, javaProject)) {
                    paths.add(getAbsoluteLocation(resolved));
                }
            }
            classPaths.addAll(xformPaths);
            assert classPaths.stream().map(File::new).allMatch(File::isAbsolute);
        } catch (Exception e) {
// Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
//	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
            throw new RuntimeException(e);
        }
    }

    private static IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry classpathEntry, IJavaProject javaProject) throws Exception {
//Caused by: java.lang.reflect.InvocationTargetException
//	at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
//	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
//	at java.lang.reflect.Method.invoke(Method.java:498)
//	at org.eclipse.jdt.groovy.core.util.ReflectionUtils.throwableExecutePrivateMethod(ReflectionUtils.java:117)
        //return JavaRuntime.resolveRuntimeClasspathEntry(classpathEntry, javaProject); // indirect dependency on org.eclipse.debug.core.ILaunchConfiguration
        return ReflectionUtils.throwableExecutePrivateMethod(JavaRuntime.class, "resolveRuntimeClasspathEntry", new Class[] {IRuntimeClasspathEntry.class, IJavaProject.class}, JavaRuntime.class, new Object[] {classpathEntry, javaProject});
    }

//Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
//	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
//	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
//	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
//	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)

https://github.com/eclipse/buildship/blob/master/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/GradleClasspathContainerRuntimeClasspathEntryResolver.java#L78

Looks like your Gradle Classpath Container is in a stale state. Can you try refresh of Gradle on your project?

@mauromol
Copy link
Author

mauromol commented Apr 15, 2020

Whoops, I didn't notice the references to the Gradle plugin... The problem is that the involved project is NOT a Gradle project... I think I have to report to them then, unless you think that it's something on Greclipse side that triggers that code (while it should not). What do you think?

@eric-milles
Copy link
Member

What does the .project file of your TestGroovy project look like? I think you might have the Gradle nature on it.

@mauromol
Copy link
Author

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>TestGroovy</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
</projectDescription>

No Gradle nature...

@eric-milles
Copy link
Member

Does your TestGroovy project have a build.gradle or a .settings/org.eclipse.buildship.core.prefs? In the Package/Project Explorer, does it have a Project and External Dependencies node (.classpath file has <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>)?

@mauromol
Copy link
Author

  • no build.gradle file exists in TestGroovy project
  • no .settings/org.eclipse.buildship.core.prefs in that project
  • no "Project and External Dependencies" node, only "JRE System Library", "Groovy DSL Support", "Groovy Libraries", "Referenced Libraries"

However, now that I look at the .classpath file I see that in TestGroovy build path there's a dependency against another project which is indeed a Gradle project. This is likely to be the cause, but I cannot yet say whether it's a Greclipse or Buildship fault...

@eric-milles
Copy link
Member

Greclipse needs to resolve the transitive dependencies of linked projects. I'm not sure how Buildship/Gradle thinks the classpath container belongs to the TestGroovy project.

@eric-milles
Copy link
Member

eric-milles commented Apr 15, 2020

Turns out IRuntimeClasspathEntry has a getJavaProject() method. I'm testing now using the return value from that to resolve each entry.

@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

I updated to 3.8.0.v202004152128-e1912, but I still see the problem. The error in the log is this:

eclipse.buildId=4.14.0.I20191210-0610
java.version=1.8.0_242
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Command-line arguments:  -data file:/home/mauro/workspace/rolling/DCS-SHOP-trunk/ -os linux -ws gtk -arch x86_64

org.eclipse.core.resources
Error
Thu Apr 16 09:12:46 CEST 2020
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:174)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:115)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.lambda$0(GroovyParser.java:120)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:181)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingParser.dietParse(MultiplexingParser.java:45)
	at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:861)
	at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:404)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:454)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:436)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:410)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:218)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:342)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:80)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:275)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:187)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:151)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:149)
	... 26 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.resolveRuntimeClasspathEntry(GroovyClassLoaderFactory.java:204)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:191)
	... 29 more
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)
	at org.eclipse.jdt.internal.launching.DefaultEntryResolver.resolveRuntimeClasspathEntry(DefaultEntryResolver.java:70)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1508)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1444)
	... 34 more

As an additional problem, when I hit Ctrl+Shift+T to open a class in TestGroovy/src, I now get this:

immagine

And the Eclipse log contains this:

eclipse.buildId=4.14.0.I20191210-0610
java.version=1.8.0_242
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Command-line arguments:  -data file:/home/mauro/workspace/rolling/DCS-SHOP-trunk/ -os linux -ws gtk -arch x86_64

org.codehaus.groovy.eclipse.dsl
Error
Thu Apr 16 09:12:19 CEST 2020
Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'

java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:174)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:115)
	at org.codehaus.jdt.groovy.integration.internal.GroovyLanguageSupport.newGroovyClassLoader(GroovyLanguageSupport.java:289)
	at org.codehaus.groovy.eclipse.dsl.script.DSLDScriptExecutor.getGroovyClassLoader(DSLDScriptExecutor.java:137)
	at org.codehaus.groovy.eclipse.dsl.script.DSLDScriptExecutor.executeScript(DSLDScriptExecutor.java:73)
	at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.refreshProject(RefreshDSLDJob.java:189)
	at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.run(RefreshDSLDJob.java:118)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:151)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:149)
	... 7 more
Caused by: java.lang.reflect.InvocationTargetException
	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.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.resolveRuntimeClasspathEntry(GroovyClassLoaderFactory.java:204)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:191)
	... 10 more
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)
	at org.eclipse.jdt.internal.launching.DefaultEntryResolver.resolveRuntimeClasspathEntry(DefaultEntryResolver.java:70)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1508)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1444)
	... 16 more

repeated 9 times, followed by:

eclipse.buildId=4.14.0.I20191210-0610
java.version=1.8.0_242
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Command-line arguments:  -data file:/home/mauro/workspace/rolling/DCS-SHOP-trunk/ -os linux -ws gtk -arch x86_64

org.eclipse.core.resources
Error
Thu Apr 16 09:12:46 CEST 2020
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:174)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:115)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.lambda$0(GroovyParser.java:120)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:181)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingParser.dietParse(MultiplexingParser.java:45)
	at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:861)
	at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:404)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:454)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:436)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:410)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:218)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:342)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:80)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:275)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:187)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:151)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:149)
	... 26 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.resolveRuntimeClasspathEntry(GroovyClassLoaderFactory.java:204)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:191)
	... 29 more
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)
	at org.eclipse.jdt.internal.launching.DefaultEntryResolver.resolveRuntimeClasspathEntry(DefaultEntryResolver.java:70)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1508)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1444)
	... 34 more

and:

eclipse.buildId=4.14.0.I20191210-0610
java.version=1.8.0_242
java.vendor=Private Build
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT
Command-line arguments:  -data file:/home/mauro/workspace/rolling/DCS-SHOP-trunk/ -os linux -ws gtk -arch x86_64

org.eclipse.jdt.core
Error
Thu Apr 16 09:14:33 CEST 2020
Exception occurred during problem detection:
----------------------------------- SOURCE BEGIN -------------------------------------
class Test60 {
	
}
----------------------------------- SOURCE END -------------------------------------

java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'TestGroovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:174)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:115)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.lambda$0(GroovyParser.java:120)
	at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:181)
	at org.codehaus.jdt.groovy.integration.internal.MultiplexingSourceElementRequestorParser.parseCompilationUnit(MultiplexingSourceElementRequestorParser.java:89)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:279)
	at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.buildStructure(GroovyCompilationUnit.java:312)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:268)
	at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:113)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:598)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:325)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:311)
	at org.eclipse.jdt.internal.core.JavaElement.exists(JavaElement.java:228)
	at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.setResult(FilteredTypesSelectionDialog.java:398)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.computeResult(FilteredItemsSelectionDialog.java:981)
	at org.eclipse.ui.dialogs.SelectionStatusDialog.okPressed(SelectionStatusDialog.java:149)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.okPressed(FilteredItemsSelectionDialog.java:1001)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleDoubleClick(FilteredItemsSelectionDialog.java:756)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$6(FilteredItemsSelectionDialog.java:665)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:777)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:774)
	at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1092)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1205)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:251)
	at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:249)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:308)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5676)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4935)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4429)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.open(FilteredTypesSelectionDialog.java:446)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.runWithEvent(OpenTypeAction.java:83)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.runWithEvent(OpenTypeAction.java:170)
	at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:281)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	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.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:308)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:584)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:653)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:443)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$2(KeyBindingDispatcher.java:386)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:96)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1842)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1422)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1449)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1473)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:837)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3997)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:857)
	at org.eclipse.swt.widgets.Tree.gtk_key_press_event(Tree.java:2256)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2269)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6826)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:4200)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5917)
	at org.eclipse.swt.internal.gtk.GTK._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(GTK.java:4168)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1480)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1604)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4427)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:198)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:151)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:149)
	... 100 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.resolveRuntimeClasspathEntry(GroovyClassLoaderFactory.java:204)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:191)
	... 103 more
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Model not available for TestGroovy
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:77)
	at org.eclipse.buildship.core.internal.workspace.GradleClasspathContainerRuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(GradleClasspathContainerRuntimeClasspathEntryResolver.java:66)
	at org.eclipse.jdt.internal.launching.RuntimeClasspathEntryResolver.resolveRuntimeClasspathEntry(RuntimeClasspathEntryResolver.java:110)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1505)
	at org.eclipse.jdt.internal.launching.DefaultEntryResolver.resolveRuntimeClasspathEntry(DefaultEntryResolver.java:70)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1508)
	at org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspathEntry(JavaRuntime.java:1444)
	... 108 more

My question: did you change anything recently with regards to this? I mean, I have been using a similar project setup for years with no problems, but only recently it started to throw exceptions.
Because if nothing has changed on Greclipse side, it must have been changed on Buildship side I'd say...

@eric-milles
Copy link
Member

eric-milles commented Apr 16, 2020

I can recreate locally. And it turns out to be a bug in JDT's DefaultEntryResolver:

	@Override
	public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project, boolean excludeTestCode) throws CoreException {
		IRuntimeClasspathEntry2 entry2 = (IRuntimeClasspathEntry2)entry;
		IRuntimeClasspathEntry[] entries = entry2.getRuntimeClasspathEntries(excludeTestCode);
		List<IRuntimeClasspathEntry> resolved = new ArrayList<>();
		for (int i = 0; i < entries.length; i++) {
			IRuntimeClasspathEntry[] temp = JavaRuntime.resolveRuntimeClasspathEntry(entries[i], project, excludeTestCode);
			//                              should pass "entries[i].getJavaProject()" instead of ^^^^^^^
			for (int j = 0; j < temp.length; j++) {
				resolved.add(temp[j]);
			}
		}
		return resolved.toArray(new IRuntimeClasspathEntry[resolved.size()]);
	}

I will pursue a fix with the eclipse.jdt.debug project.

@eric-milles
Copy link
Member

eric-milles commented Apr 16, 2020

@eric-milles eric-milles added this to the v3.8.0 milestone Apr 16, 2020
@mauromol
Copy link
Author

@eric-milles sorry for annoying you, did you see Sarika Sinha's comment to your Gerrit? :-)

@eric-milles eric-milles self-assigned this May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants