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

NoClassDefFoundError: Could not initialize class org.eclipse.buildship.ui.internal.console.ConsoleProcessStreamsProvider$BackgroundJobProcessStream #1078

Open
jmini opened this issue Apr 13, 2021 · 4 comments

Comments

@jmini
Copy link

jmini commented Apr 13, 2021

Expected Behavior

I can import my gradle projects correctly. Without error.

Current Behavior

When I import my gradle project (multi modules gradle build) by selecting the root of the repo where they are located, then the import fails.
I just get one project imported (with the name of the root folder of the repo).

When if I hit "Refresh Gradle project" from the context menu later on it fails with the same error.

Your Environment

Eclipse Version: Version: 2021-03 (4.19.0), Build id: 20210312-0638 (updated with the eclipse installer. A.k.a Oomph)
Buildship: Eclipse Plug-ins for Gradle 3.1.5.v20210113-0929 (also installed automatically with the installer)

Gradle version of the project:

------------------------------------------------------------
Gradle 6.7.1
------------------------------------------------------------

Build time:   2020-11-16 17:09:24 UTC
Revision:     2972ff02f3210d2ceed2f1ea880f026acfbab5c0

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          1.8.0_202 (Azul Systems, Inc. 25.202-b05)
OS:           Mac OS X 10.15.2 x86_64

Stack-trace

Copy-pasted from the Eclispe Error log view:

com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.buildship.ui.internal.console.ConsoleProcessStreamsProvider$BackgroundJobProcessStream
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3953)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4873)
	at org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.getFromCache(DefaultModelProvider.java:98)
	at org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.executeOperation(DefaultModelProvider.java:90)
	at org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.fetchEclipseProjectAndRunSyncTasks(DefaultModelProvider.java:72)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.runInToolingApi(DefaultGradleBuild.java:226)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:58)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:39)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.run(DefaultGradleBuild.java:192)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:100)
	at org.eclipse.buildship.core.internal.workspace.SynchronizationJob.runInToolingApi(SynchronizationJob.java:64)
	at org.eclipse.buildship.core.internal.workspace.SynchronizationJob.runInToolingApi(SynchronizationJob.java:30)
	at org.eclipse.buildship.core.internal.operation.ToolingApiJob$1.runInToolingApi(ToolingApiJob.java:54)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:58)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:39)
	at org.eclipse.buildship.core.internal.operation.ToolingApiJob.run(ToolingApiJob.java:65)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.buildship.ui.internal.console.ConsoleProcessStreamsProvider$BackgroundJobProcessStream
	at org.eclipse.buildship.ui.internal.console.ConsoleProcessStreamsProvider.getBackgroundJobProcessStreams(ConsoleProcessStreamsProvider.java:35)
	at org.eclipse.buildship.core.internal.gradle.GradleProgressAttributes$GradleProgressAttributesBuilder.build(GradleProgressAttributes.java:151)
	at org.eclipse.buildship.core.internal.util.gradle.IdeAttachedProjectConnection.newInstance(IdeAttachedProjectConnection.java:107)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild$GradleConnectionOperation.runInToolingApi(DefaultGradleBuild.java:323)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:58)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
	at org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:39)
	at org.eclipse.buildship.core.internal.DefaultGradleBuild.withConnection(DefaultGradleBuild.java:122)
	at org.eclipse.buildship.core.internal.workspace.DefaultModelProvider.lambda$fetchEclipseProjectAndRunSyncTasks$5(DefaultModelProvider.java:75)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4878)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	... 21 more

I am happy to provide more info if necessary.

@jmini
Copy link
Author

jmini commented Apr 13, 2021

If you need a multi module project to reproduce, you can just run gradle ini (with gradle 6.7.1) it creates a multi module one:

$ mkdir tmpgradle
$ cd tmpgradle/
$ gradle init 

Select type of project to generate:
  1: basic
  2: application
  3: library
  4: Gradle plugin
Enter selection (default: basic) [1..4] 3

Select implementation language:
  1: C++
  2: Groovy
  3: Java
  4: Kotlin
  5: Scala
  6: Swift
Enter selection (default: Java) [1..6] 3

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 1

Select test framework:
  1: JUnit 4
  2: TestNG
  3: Spock
  4: JUnit Jupiter
Enter selection (default: JUnit 4) [1..4] 4

Project name (default: tmpgradle): 
Source package (default: tmpgradle): 

@jmini
Copy link
Author

jmini commented Apr 13, 2021

Same error with a single module build (no settings.gradle)

@jmini
Copy link
Author

jmini commented Apr 13, 2021

As comparison, if I create this with gradle 6.7.1, inside a tmpgradle/ folder:

$ gradle init 

Select type of project to generate:
  1: basic
  2: application
  3: library
  4: Gradle plugin
Enter selection (default: basic) [1..4] 2

Select implementation language:
  1: C++
  2: Groovy
  3: Java
  4: Kotlin
  5: Scala
  6: Swift
Enter selection (default: Java) [1..6] 3

Split functionality across multiple subprojects?:
  1: no - only one application project
  2: yes - application and library projects
Enter selection (default: no - only one application project) [1..2] 2

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 1

Project name (default: tmpgradle): 
Source package (default: tmpgradle): 

And I import it in an older Eclipse:

Eclipse IDE for Java Developers (includes Incubating components)

Version: 2020-12 (4.18.0)
Build id: 20201210-1552

Where Buildship: Eclipse Plug-ins for Gradle has version 3.1.4.v20200326-1743

Importing all the projects by pointing to the tmpgradle folder
It works perfectly:

Screenshot of Eclipse IDE for Java Developers version 2020-12 after the import of tmpgradle

@jmini
Copy link
Author

jmini commented Apr 14, 2021

After having read this message [eclipse.org-committers] Critical bug made it into Eclipse 4.19 (any plans on removing it or providing a new build?) and Bug 571990 I thought I could give newest build of Eclipse a try.

With:

eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.19.0.I20210303-1800

And Buildship 3.1.5.v20210113-0929, I can confirm that my simple test described in my previous #1078 (comment) is working. No error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant