[GRADLE-2085] Could not create task of type 'Test' Created: 07/Feb/12  Updated: 04/Jan/13  Resolved: 07/Feb/12

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

Type: Improvement
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

I'm having this error while building a project: Cause: Could not create task of type 'Test'. what am i missing here? i'm using the latest release



 Comments   
Comment by Gradle Forums [ 07/Feb/12 ]

Please provide the build script and full stack trace (-s).

Comment by Gradle Forums [ 07/Feb/12 ]

Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'hello'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:474)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:73)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:450)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:445)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:141)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:233)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:217)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type 'Test'.
at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:112)
at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:107)
at org.gradle.api.internal.AbstractTask.injectIntoNewInstance(AbstractTask.java:125)
at org.gradle.api.internal.project.taskfactory.TaskFactory.createTaskObject(TaskFactory.java:107)
at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:55)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory.createTask(AnnotationProcessingTaskFactory.java:64)
at org.gradle.api.internal.project.taskfactory.DependencyAutoWireTaskFactory.createTask(DependencyAutoWireTaskFactory.java:39)
at org.gradle.api.internal.tasks.DefaultTaskContainer.add(DefaultTaskContainer.java:49)
at org.gradle.api.internal.tasks.DefaultTaskContainer.add(DefaultTaskContainer.java:72)
at org.gradle.api.plugins.JavaPlugin.configureTest(JavaPlugin.java:145)
at org.gradle.api.plugins.JavaPlugin.apply(JavaPlugin.java:73)
at org.gradle.api.plugins.JavaPlugin.apply(JavaPlugin.java:47)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:841)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:35)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at build_188om727jd3rsd1obj4mhsmsav.run(/hello/build.gradle:1)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 30 more
Caused by: org.gradle.util.UncheckedException: java.net.UnknownHostException: Bit: Bit
at org.gradle.util.UncheckedException.asUncheckedException(UncheckedException.java:31)
at org.gradle.messaging.remote.internal.MessagingServices.determineNodeName(MessagingServices.java:96)
at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:81)
at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:73)
at org.gradle.messaging.remote.internal.MessagingServices.(MessagingServices.java:69)
at org.gradle.api.internal.project.GlobalServicesRegistry.createMessagingServices(GlobalServicesRegistry.java:85)
at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)
at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)
at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)
at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)
at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)
at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)
at org.gradle.api.internal.project.GlobalServicesRegistry.createMessagingServer(GlobalServicesRegistry.java:89)
at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)
at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)
at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)
at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)
at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)
at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)
at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:391)
at org.gradle.api.internal.project.DefaultServiceRegistry.get(DefaultServiceRegistry.java:133)
at org.gradle.api.internal.project.TopLevelBuildServiceRegistry.createWorkerProcessFactory(TopLevelBuildServiceRegistry.java:207)
at org.gradle.api.internal.project.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:167)
at org.gradle.api.internal.project.DefaultServiceRegistry.access$100(DefaultServiceRegistry.java:51)
at org.gradle.api.internal.project.DefaultServiceRegistry$FactoryMethodService.create(DefaultServiceRegistry.java:286)
at org.gradle.api.internal.project.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:186)
at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:232)
at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getFactory(DefaultServiceRegistry.java:252)
at org.gradle.api.internal.project.DefaultServiceRegistry$SingletonService.getFactory(DefaultServiceRegistry.java:240)
at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)
at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)
at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)
at org.gradle.api.internal.project.DefaultServiceRegistry$NestedServices.getFactory(DefaultServiceRegistry.java:349)
at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)
at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)
at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)
at org.gradle.api.internal.project.DefaultServiceRegistry$ParentServices.getFactory(DefaultServiceRegistry.java:378)
at org.gradle.api.internal.project.DefaultServiceRegistry.getFactory(DefaultServiceRegistry.java:150)
at org.gradle.api.tasks.testing.Test.(Test.java:114)
at org.gradle.api.tasks.testing.Test_Decorated.(Unknown Source)
at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:110)
... 54 more
Caused by: java.net.UnknownHostException: Bit: Bit
at org.gradle.messaging.remote.internal.MessagingServices.determineNodeName(MessagingServices.java:94)
... 93 more

Build script is only:
apply plugin: 'java'

im thinking this might be a folder permission thing. i've tried building this in windows and it worked. this error only appears in linux

Comment by Gradle Forums [ 07/Feb/12 ]

This means that java.net.InetAdress.getLocalHost() doesn't work on your Linux machine. It's unable to determine the IP address for localhost. Do you have an explanation for this?

Comment by Gradle Forums [ 07/Feb/12 ]

Fixed! it's looking for Bit host. i've edit my /etc/hosts file and added Bit thanks!

Comment by Gradle Forums [ 07/Feb/12 ]

Just bumped on to same issue while building spring framework. Adding computer name to /etc/hosts solved it.

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