[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 ]
  • Is the error consistent?
  • What if you just create small task that only resolves this configuration and nothing else?
  • Does it also fail if you do --refresh-dependencies?
  • Anything unusual about the dependencies declared to the 'testtools' configuration?
  • Can you nail down which dependency makes it breaking?

Thanks!

Comment by Jonathan Imperial [ 05/Oct/12 ]

Hi Szczepan,

A little bit more about the project that might help:

  • In order to run the integration tests, we need to launch several jboss servers on build machine. We launch them using the groovy Process API, then kill them after the tests have finished. The testtools configuration is a configuration set up with all of our test dependencies, as we are using maven classifiers for our tests and thus the test dependencies are not picked up from the pom file.
  • The testtools dependencies consists of the module which the integration tests are specifically for, the core application, junit, hsqldb, jboss-client.jar, and a test utility package each module depends on in test compile.
  • Each module may have several submodules, each with their own set of tests. Some of these tests need to run in a separate VM, in order to do this we read from a property file and generate several test tasks which need to be run.

To answer your questions:

  • The error is fairly consistent. The build will be fine for maybe 6 builds, then will consistently break around 3 times in a row.
  • We created a small task in our custom plugin that resolves only this configuration. The task code is seen below:
    project.tasks.add(name: 'resolveTestToolsDependencies') << {
                            doLast {
                                    project.configurations.testtools.resolve()
                            }
                    }

    When we add this task to the list of running tasks, we get the following error:

    Starting Build
    Settings evaluated using empty settings script.
    Projects loaded. Root project using build file '/home/developer/jenkins/workspace/module_test_development/build.gradle'.
    Included projects: [root project 'module_test_development']
    Evaluating root project 'module_test_development' using build file '/home/developer/jenkins/workspace/module_test_development/build.gradle'.
    All projects evaluated.
    Selected primary tasks 'loadProperties', 'resolveTestToolsDependencies', 'launchDataServer', 'launchEngineServer', 'launchRiskServer', 'launchDispatcher', 'launchCalculator', 'runJunitTests', 'runIntegrationTests', 'runIntegrationTestsWithDispatcher', 'cleanupProcesses', 'generateCodeCoverageReport', 'archiveData'
    Tasks to be executed: [task ':loadProperties', task ':resolveTestToolsDependencies', task ':launchDataServer', task ':launchEngineServer', task ':launchRiskServer', task ':launchDispatcher', task ':launchCalculator', task ':runJunitTests', task ':runIntegrationTests', task ':runIntegrationTestsWithDispatcher', task ':cleanupProcesses', task ':generateCodeCoverageReport', task ':archiveData']
    :loadProperties
    Task ':loadProperties' has not declared any outputs, assuming that it is out-of-date.
    :resolveTestToolsDependencies
    Task ':resolveTestToolsDependencies' has not declared any outputs, assuming that it is out-of-date.
    
    FAILURE: Build aborted because of an internal error.
    
    * What went wrong:
    Build aborted because of an unexpected internal error. Please file an issue at: http://forums.gradle.org.
    
    * Try:
    Run with --debug option to get additional debug info.
    
    * Exception is:
    java.util.ConcurrentModificationException
    	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
    	at java.util.AbstractList$Itr.next(AbstractList.java:343)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:56)
    	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
    	at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
    	at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200)
    	at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172)
    	at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
    	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111)
    	at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
    	at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
    	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
    	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.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
    	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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	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)
    
    
    BUILD FAILED
    
    Total time: 4.528 secs
    Done run, took 3 min 58 sec
  • We are always running with --refresh-dependencies, as we are depending on a test classifier which is not considered changing. (the regex for a changing module is considered .*-SNAPSHOT)
  • Nothing is terribly unusual about the testtools dependencies.
  • We are not sure which dependency is making it break. We will try to get an output with debug log and attach to JIRA, since this is only happening on the CI machine.
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:

  1. Core application build triggers and finishes during the start of the test runtime
    • Example: CORE triggers at 10:41 PM and finishes at 11:03 PM. Test integration kicks off at 11:00 PM as it was in the queue from a previous build. NPE will continually happen until a new SNAPSHOT is published to the repository.
  2. Gradle cache is cleared out to gain more file space. Cache grows to about 40G+ during a single day, we need to clean out the cache once every 4-5 days. NPE will occur until a new SNAPSHOT is published to the repository.

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:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

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.

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