[GRADLE-2509] NPE in org.gradle.api.internal.CachingDirectedGraphWalker Created: 04/Oct/12 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.2 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Jonathan Imperial | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Description |
While trying to run a custom JUnit test task which uses a configuration called "testtools" to get its runtime dependencies, we are running into the following error: :: loading settings :: url = jar:file:/home/developer/jenkins/workspace/DEVTOOLS_TRUNK_INSTALL/devtools/build-tools/gradle-1.0/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml Cached resource is up-to-date (lastModified: Wed Oct 01 15:19:19 PDT 2008). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom] Cached resource is up-to-date (lastModified: Tue May 02 16:56:06 PDT 2006). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/javax/mail/mail/1.4/mail-1.4.pom] Cached resource is up-to-date (lastModified: Thu Mar 16 19:27:22 PST 2006). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.pom] Cached resource is up-to-date (lastModified: Tue Dec 06 12:10:43 PST 2005). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.pom] Cached resource is up-to-date (lastModified: Tue May 02 16:48:29 PDT 2006). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/javax/activation/activation/1.1/activation-1.1.pom] Cached resource is up-to-date (lastModified: Mon Nov 26 12:24:10 PST 2007). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom] Cached resource is up-to-date (lastModified: Wed Nov 14 14:58:59 PST 2007). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/org/apache/commons/commons-parent/5/commons-parent-5.pom] Resource missing. [HTTP HEAD: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/org/apache/commons/commons-parent/5/commons-parent-5.jar] Cached resource is up-to-date (lastModified: Fri Dec 22 05:37:52 PST 2006). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.pom] Cached resource is up-to-date (lastModified: Fri Jan 12 22:28:39 PST 2007). [HTTP: http://nexus.calypso.com/nexus/content/groups/calypso-artifacts/antlr/antlr/2.7.7/antlr-2.7.7.pom] FAILURE: Build failed with an exception. * What went wrong: Failed to notify task execution listener. > Failed to notify task execution listener. > Could not resolve all dependencies for configuration ':testtools'. > java.lang.NullPointerException (no error message) * Try: Run with --debug option to get more log output. * Exception is: org.gradle.listener.ListenerNotificationException: Failed to notify task execution listener. at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at $Proxy7.beforeExecute(Unknown Source) at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:190) at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177) at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31) at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111) at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126) at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103) at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79) at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78) at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42) at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31) at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20) at org.gradle.launcher.Main.doAction(Main.java:48) at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.Main.main(Main.java:39) at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.GradleMain.main(GradleMain.java:24) Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify task execution listener. at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at $Proxy7.beforeExecute(Unknown Source) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88) ... 40 more Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify task execution listener. at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:97) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88) ... 46 more Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':testtools'. at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:47) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.access$000(ErrorHandlingArtifactDependencyResolver.java:26) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.getFiles(ErrorHandlingArtifactDependencyResolver.java:80) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:460) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:203) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:191) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:103) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:182) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75) at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88) at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143) at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30) at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38) at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60) at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42) at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule.create(InputFilesChangedUpToDateRule.java:35) at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(CompositeUpToDateRule.java:35) at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java:80) at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:88) at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:128) at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$ShortCircuitArtifactState.isUpToDate(ShortCircuitTaskArtifactStateRepository.java:77) at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java:37) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42) at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247) at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:242) at org.gradle.api.internal.TaskInternal$execute.call(Unknown Source) at com.calypso.gradle.plugins.JunitLifecycleListener$_beforeExecute_closure1.doCall(CalypsoTestIntegrationPlugin.groovy:864) at com.calypso.gradle.plugins.JunitLifecycleListener.beforeExecute(CalypsoTestIntegrationPlugin.groovy:862) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88) ... 48 more Caused by: java.lang.NullPointerException at org.gradle.api.internal.CachingDirectedGraphWalker$NodeDetails.access$100(CachingDirectedGraphWalker.java:145) at org.gradle.api.internal.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:124) at org.gradle.api.internal.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:63) at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.getFiles(DefaultLenientConfiguration.java:111) at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.getFilesStrict(DefaultLenientConfiguration.java:98) at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.getFiles(DefaultResolvedConfiguration.java:45) at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$1.getFiles(SelfResolvingDependencyResolver.java:56) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.getFiles(ErrorHandlingArtifactDependencyResolver.java:78) ... 84 more BUILD FAILED Total time: 1 mins 13.267 secs Done run, took 4 min 16 sec The goal of this task is to download a set of integration test jars, unpack the class files, and run the tests against a deployed system. This error occurs while the test task is evaluating the configuration. |
Comments |
Comment by Szczepan Faber [ 05/Oct/12 ] |
Thanks! |
Comment by Jonathan Imperial [ 05/Oct/12 ] |
Hi Szczepan, A little bit more about the project that might help:
To answer your questions:
|
Comment by Szczepan Faber [ 08/Oct/12 ] |
Hey, the last exception is because you're configuring a doLast() action at execution time (no doubt Gradle should throw much better exception). Drop the '<<' from the task configuration. |
Comment by Jonathan Imperial [ 08/Oct/12 ] |
Good catch. With the fixed task, the NPE error occurs much less (happens around 20% of the time compared to the previous 50% of the time). We trying to break apart the testtools configuration to our jars and third party jars to get a better idea where it is breaking. |
Comment by Jonathan Imperial [ 09/Oct/12 ] |
Just as an update, we split the testtools dependencies into our snapshots vs third party dependencies. For our snapshot files, we copy the configuration into a folder and use this folder for the rest of the tests. What we found is that the build is much more stable than before, however the NPE still manifests itself. After looking into the build times, we see that the NPE error occurs when the following examples occur:
We were able to replicate by deleting the caches folder inside $HOME/.gradle during a run. We expected the build to break (obviously), but we expected the build to recover during the next runtime. The only way we were able to fix the NPE without triggering a new jar build of snapshot was to delete the whole ~/.gradle and .gradle project folder and rebuild. |
Comment by Marcin Cieślak [ 17/May/15 ] |
I get almost the same exception just by running `./gradlew tasks`. 100% reproducible. |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |