[GRADLE-2222] compileScala: Cannot invoke method withInputStream() on null object Created: 11/Apr/12 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Antony Stubbs | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 1 |
Attachments: | GRADLE-2222.zip |
Description |
An empty main/src/scala dir doesn't cause an issue, but if i put any scala files in there, I get: 17:59:13.329 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':compileScala' 17:59:13.330 [ERROR] [org.gradle.BuildExceptionReporter] 17:59:13.331 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 17:59:13.331 [ERROR] [org.gradle.BuildExceptionReporter] 17:59:13.332 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 17:59:13.332 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compileScala'. 17:59:13.334 [ERROR] [org.gradle.BuildExceptionReporter] > Cannot invoke method withInputStream() on null object 17:59:13.335 [ERROR] [org.gradle.BuildExceptionReporter] 17:59:13.335 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 17:59:13.336 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileScala'. 17:59:13.337 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68) 17:59:13.337 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 17:59:13.337 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34) 17:59:13.338 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34) 17:59:13.338 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200) 17:59:13.338 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172) 17:59:13.339 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198) 17:59:13.339 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111) 17:59:13.339 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83) 17:59:13.340 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32) 17:59:13.340 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55) 17:59:13.340 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) 17:59:13.341 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41) 17:59:13.341 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) 17:59:13.341 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52) 17:59:13.341 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42) 17:59:13.342 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247) 17:59:13.342 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192) 17:59:13.342 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177) 17:59:13.343 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83) 17:59:13.343 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36) 17:59:13.343 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 17:59:13.344 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 17:59:13.344 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 17:59:13.344 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31) 17:59:13.345 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111) 17:59:13.345 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126) 17:59:13.345 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109) 17:59:13.345 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103) 17:59:13.346 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79) 17:59:13.346 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29) 17:59:13.347 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 17:59:13.347 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 17:59:13.347 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 17:59:13.348 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 17:59:13.348 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 17:59:13.348 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) 17:59:13.349 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155) 17:59:13.349 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110) 17:59:13.349 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78) 17:59:13.350 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:45) 17:59:13.350 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.protocol.Build.run(Build.java:67) 17:59:13.350 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.protocol.Build.run(Build.java:63) 17:59:13.351 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45) 17:59:13.351 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) 17:59:13.351 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.352 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:45) 17:59:13.352 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.352 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24) 17:59:13.353 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.353 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34) 17:59:13.354 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.355 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$4.call(ForwardClientInput.java:116) 17:59:13.355 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput$4.call(ForwardClientInput.java:114) 17:59:13.356 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.Swapper.swap(Swapper.java:38) 17:59:13.356 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:114) 17:59:13.356 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.357 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) 17:59:13.357 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) 17:59:13.357 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.358 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:61) 17:59:13.358 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) 17:59:13.358 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.359 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49) 17:59:13.359 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) 17:59:13.359 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.360 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36) 17:59:13.360 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.360 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32) 17:59:13.361 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.361 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(HandleClientDisconnectBeforeSendingCommand.java:21) 17:59:13.361 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.362 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(StopConnectionAfterExecution.java:27) 17:59:13.362 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 17:59:13.363 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:55) 17:59:13.363 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.server.Daemon$1$1.run(Daemon.java:123) 17:59:13.364 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66) 17:59:13.364 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException: Cannot invoke method withInputStream() on null object 17:59:13.365 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AntBuilderDelegate.taskdef(DefaultIsolatedAntBuilder.groovy:137) 17:59:13.365 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.scala.AntScalaCompiler$_execute_closure1.doCall(AntScalaCompiler.groovy:53) 17:59:13.366 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:141) 17:59:13.367 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:90) 17:59:13.367 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil$configure.call(Unknown Source) 17:59:13.368 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.DefaultIsolatedAntBuilder.execute(DefaultIsolatedAntBuilder.groovy:113) 17:59:13.368 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.IsolatedAntBuilder$execute.call(Unknown Source) 17:59:13.369 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.scala.AntScalaCompiler.execute(AntScalaCompiler.groovy:52) 17:59:13.369 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.scala.AntScalaCompiler.execute(AntScalaCompiler.groovy) 17:59:13.369 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompiler.execute(DefaultScalaJavaJointCompiler.java:35) 17:59:13.370 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompiler.execute(DefaultScalaJavaJointCompiler.java:25) 17:59:13.370 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute(IncrementalJavaCompilerSupport.java:33) 17:59:13.370 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute(IncrementalJavaCompilerSupport.java:23) 17:59:13.371 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.scala.ScalaCompile.compile(ScalaCompile.java:90) 17:59:13.371 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196) 17:59:13.372 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102) 17:59:13.372 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99) 17:59:13.372 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.scala.ScalaCompile_Decorated.invokeMethod(Unknown Source) 17:59:13.373 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23) 17:59:13.373 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150) 17:59:13.374 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145) 17:59:13.374 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:477) 17:59:13.374 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:466) 17:59:13.375 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60) 17:59:13.375 [ERROR] [org.gradle.BuildExceptionReporter] ... 76 more 17:59:13.375 [ERROR] [org.gradle.BuildExceptionReporter] 17:59:13.376 [LIFECYCLE] [org.gradle.BuildResultLogger] 17:59:13.376 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 17:59:13.377 [LIFECYCLE] [org.gradle.BuildResultLogger] 17:59:13.377 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 3.409 secs |
Comments |
Comment by Antony Stubbs [ 11/Apr/12 ] |
Sample project exhibiting error |
Comment by Antony Stubbs [ 11/Apr/12 ] |
(! 973)-> gradle --version ------------------------------------------------------------ Gradle build time: Tuesday, 13 March 2012 4:10:09 PM UTC |
Comment by Wojtek Erbetowski [ 13/Apr/12 ] |
Same here, I'm not able to compile simplest possible scala project. |
Comment by Antony Stubbs [ 13/Apr/12 ] |
My main project has actually miraculously started compiling Scala. I will try to bisect and find out what I changed to make it work. |
Comment by Adam Murdoch [ 13/Apr/12 ] |
You need to declare which version of scale to use, and where to get it from: http://gradle.org/docs/current/userguide/scala_plugin.html#N12952 We will improve the error message, so that you get a useful message telling you this, rather than a NPE. |
Comment by Antony Stubbs [ 13/Apr/12 ] |
Ah - my project probably started working when I added the dependencies that pulled in a specific version, can't the plugin pull in a version by default, and you show a warning that you should explicitly declare a version?. |
Comment by Adam Murdoch [ 13/Apr/12 ] |
Yes, we might end up doing something like this. |
Comment by Wojtek Erbetowski [ 17/Apr/12 ] |
scalaTools 'org.scala-lang:scala-compiler:2.9.1' |
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. |