[GRADLE-1800] Tooling API: Sporadic model-build failures because of LinkedList.remove => NoSuchElementException Created: 20/Sep/11  Updated: 04/Jan/13  Resolved: 16/Mar/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-5
Fix Version/s: 1.0-milestone-8

Type: Bug
Reporter: Kris De Volder Assignee: Szczepan Faber
Resolution: Fixed Votes: 0


 Description   

I've seen this exception a few times. It seems unpredictable, sometimes it happens, sometimes it doesn't. Maybe some type of race condition?

I have no method to reliably reproduce this so all I can provide is this stacktrace. However, I've already seen it happen a couple of times in the nightly STS integration test build.

20-Sep-2011 04:26:12 	testImportSpringDataRedis(com.springsource.gradle.core.test.GradleImportTests)  Time elapsed: 153.361 sec  <<< ERROR!
20-Sep-2011 04:26:12 	java.lang.Error: org.eclipse.core.runtime.CoreException: Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-5-20110920000017+0200-bin.zip'.
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.util.ErrorHandler$Test.internalHandle(ErrorHandler.java:173)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.util.ErrorHandler.handle(ErrorHandler.java:69)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.util.ErrorHandler.handleError(ErrorHandler.java:76)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.wizards.GradleImportOperation.doTasks(GradleImportOperation.java:178)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.wizards.GradleImportOperation.perform(GradleImportOperation.java:140)
20-Sep-2011 04:26:12 	        at com.springsource.gradle.core.test.GradleTest.importGitProject(GradleTest.java:263)
20-Sep-2011 04:26:12 	        at com.springsource.gradle.core.test.GradleImportTests.testImportSpringDataRedis(GradleImportTests.java:375)
20-Sep-2011 04:26:12 	        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20-Sep-2011 04:26:12 	        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20-Sep-2011 04:26:12 	        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20-Sep-2011 04:26:12 	        at java.lang.reflect.Method.invoke(Method.java:597)
20-Sep-2011 04:26:12 	        at junit.framework.TestCase.runTest(TestCase.java:168)
20-Sep-2011 04:26:12 	        at junit.framework.TestCase.runBare(TestCase.java:134)
20-Sep-2011 04:26:12 	        at junit.framework.TestResult$1.protect(TestResult.java:110)
20-Sep-2011 04:26:12 	        at junit.framework.TestResult.runProtected(TestResult.java:128)
20-Sep-2011 04:26:12 	        at junit.framework.TestResult.run(TestResult.java:113)
20-Sep-2011 04:26:12 	        at junit.framework.TestCase.run(TestCase.java:124)
20-Sep-2011 04:26:12 	        at junit.framework.TestSuite.runTest(TestSuite.java:232)
20-Sep-2011 04:26:12 	        at junit.framework.TestSuite.run(TestSuite.java:227)
20-Sep-2011 04:26:12 	        at junit.framework.TestSuite.runTest(TestSuite.java:232)
20-Sep-2011 04:26:12 	        at junit.framework.TestSuite.run(TestSuite.java:227)
20-Sep-2011 04:26:12 	        at com.springsource.tests.util.ManagedTestSuite.run(ManagedTestSuite.java:231)
20-Sep-2011 04:26:12 	        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
20-Sep-2011 04:26:12 	        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
20-Sep-2011 04:26:12 	        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
20-Sep-2011 04:26:12 	        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
20-Sep-2011 04:26:12 	        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
20-Sep-2011 04:26:12 	        at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:72)
20-Sep-2011 04:26:12 	        at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication$1.run(AbstractUITestApplication.java:35)
20-Sep-2011 04:26:12 	        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
20-Sep-2011 04:26:12 	        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
20-Sep-2011 04:26:12 	        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3515)
20-Sep-2011 04:26:12 	        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3164)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
20-Sep-2011 04:26:12 	        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
20-Sep-2011 04:26:12 	        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
20-Sep-2011 04:26:12 	        at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31)
20-Sep-2011 04:26:12 	        at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:114)
20-Sep-2011 04:26:12 	        at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37)
20-Sep-2011 04:26:12 	        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
20-Sep-2011 04:26:12 	        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
20-Sep-2011 04:26:12 	        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
20-Sep-2011 04:26:12 	        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
20-Sep-2011 04:26:12 	        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
20-Sep-2011 04:26:12 	        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20-Sep-2011 04:26:12 	        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20-Sep-2011 04:26:12 	        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20-Sep-2011 04:26:12 	        at java.lang.reflect.Method.invoke(Method.java:597)
20-Sep-2011 04:26:12 	        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
20-Sep-2011 04:26:12 	        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
20-Sep-2011 04:26:12 	        at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
20-Sep-2011 04:26:12 	        at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
20-Sep-2011 04:26:12 	Caused by: org.eclipse.core.runtime.CoreException: Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-5-20110920000017+0200-bin.zip'.
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:34)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.util.ExceptionUtil.coreException(ExceptionUtil.java:45)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.GradleModelProvider.buildModel(GradleModelProvider.java:363)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.GradleModelProvider$GroupedModelProvider.ensureModels(GradleModelProvider.java:258)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.GradleProject.getGradleModel(GradleProject.java:529)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.GradleProject.getGradleModel(GradleProject.java:542)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.GradleProject.getTasks(GradleProject.java:736)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.TaskUtil.bulkRunEclipseTasksOn(TaskUtil.java:124)
20-Sep-2011 04:26:12 	        at com.springsource.sts.gradle.core.wizards.GradleImportOperation.doTasks(GradleImportOperation.java:176)
20-Sep-2011 04:26:12 	        ... 53 more
20-Sep-2011 04:26:12 	Caused by: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-5-20110920000017+0200-bin.zip'.
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:46)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:73)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
20-Sep-2011 04:26:12 	        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
20-Sep-2011 04:26:12 	        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
20-Sep-2011 04:26:12 	        at java.lang.Thread.run(Thread.java:619)
20-Sep-2011 04:26:12 	Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify progress listener.
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:75)
20-Sep-2011 04:26:12 	        at $Proxy0.completed(Unknown Source)
20-Sep-2011 04:26:12 	        at org.gradle.logging.internal.DefaultProgressLoggerFactory$ProgressLoggerImpl.completed(DefaultProgressLoggerFactory.java:114)
20-Sep-2011 04:26:12 	        at org.gradle.logging.internal.DefaultProgressLoggerFactory$ProgressLoggerImpl.completed(DefaultProgressLoggerFactory.java:107)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.run(ProgressLoggingConnection.java:76)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.getModel(ProgressLoggingConnection.java:59)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:53)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:51)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:71)
20-Sep-2011 04:26:12 	        ... 4 more
20-Sep-2011 04:26:12 	Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify progress listener.
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88)
20-Sep-2011 04:26:12 	        ... 14 more
20-Sep-2011 04:26:12 	Caused by: java.util.NoSuchElementException
20-Sep-2011 04:26:12 	        at java.util.LinkedList.remove(LinkedList.java:788)
20-Sep-2011 04:26:12 	        at java.util.LinkedList.removeFirst(LinkedList.java:134)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.ProgressListenerAdapter.onOperationEnd(ProgressListenerAdapter.java:35)
20-Sep-2011 04:26:12 	        at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$ProgressListenerAdapter.completed(ProgressLoggingConnection.java:102)
20-Sep-2011 04:26:12 	        at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
20-Sep-2011 04:26:12 	        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20-Sep-2011 04:26:12 	        at java.lang.reflect.Method.invoke(Method.java:597)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
20-Sep-2011 04:26:12 	        at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88)
20-Sep-2011 04:26:12 	        ... 16 more


 Comments   
Comment by Kris De Volder [ 20/Sep/11 ]

Forgot to add, this error was seen running tests against the latest M5 snapshot(s).

Comment by Szczepan Faber [ 16/Mar/12 ]

We've done many fixes wrt concurrency in M8 (and I remember this very stack trace). I believe the problem should be fixed now. Please let me know it still occurs in versions M8+.

Generated at Wed Jun 30 12:04:42 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.