Nightly fails to initialize with java.lang.ClassNotFoundException: org.gradle.api.internal.project.ServiceRegistry


(David Resnick) #1

I’m trying to build my project using the latest nightly – http://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-8-20120118143143+0100-bin.zip (this is at Daz’s suggestion here: http://forums.gradle.org/gradle/topics/dependency_download_failing_in_milestone_7)

In my project I use the gradle-rpm-plugin (com.trigonic:gradle-rpm-plugin:0.9). My build fails to complete the configuration phase, outputting the below error. The line that fails is this:

task rpm(type: Rpm) {

This is a just heads up; I can wait until a milestone candidate for this to be fixed.

– David

FAILURE: Build failed with an exception.
  * Where:
Build file 'build.gradle' line: 61
  * What went wrong:
A problem occurred evaluating project ':proj'.
Cause: Could not generate a proxy class for class com.trigonic.gradle.plugins.rpm.Rpm.
  * Try:
Run with --info or --debug option to get more log output.
  * Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':proj'.
        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:478)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:75)
        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:454)
        at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:449)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:137)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:108)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:76)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:45)
        at org.gradle.launcher.daemon.protocol.Build.run(Build.java:67)
        at org.gradle.launcher.daemon.protocol.Build.run(Build.java:63)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:45)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:32)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$4.call(ForwardClientInput.java:112)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$4.call(ForwardClientInput.java:110)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:110)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:47)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:57)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:37)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(HandleClientDisconnectBeforeSendingCommand.java:21)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(StopConnectionAfterExecution.java:22)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:52)
        at org.gradle.launcher.daemon.server.Daemon$1$1.run(Daemon.java:113)
        at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class com.trigonic.gradle.plugins.rpm.Rpm.
        at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:188)
        at org.gradle.api.internal.project.taskfactory.TaskFactory.createTaskObject(TaskFactory.java:90)
        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.project.AbstractProject.task(AbstractProject.java:924)
        at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
        at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
        at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
        at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.groovy:73)
        at build_1ccg4k6hln617n5vv6bss0oeu9.run(build.gradle:61)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
        ... 52 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/internal/project/ServiceRegistry
        at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:95)
        ... 64 more
Caused by: java.lang.ClassNotFoundException: org.gradle.api.internal.project.ServiceRegistry
        ... 65 more
    BUILD FAILED
  Total time: 3.486 secs

#2

It looks like the rpm plugin is using Gradle classes that are not part of the public API. These classes can change over time, and the rpm plugin will need to be updated for any changes.

I’d suggest trying out v1.0 of the plugin first. If that doesn’t work, contact the author to request an updated version, or submit a patch to them.