[GRADLE-2264] java.lang.NoClassDefFoundError: groovy/lang/GroovyObject Created: 01/May/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-rc-3
Fix Version/s: None

Type: Bug
Reporter: Steve Holmes Assignee: René Gröschke (Inactive)
Resolution: Won't Fix Votes: 4


 Description   

Here is the Stacktrace. I got this when building using the grails-gradle plugin.

18:22:13.629 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
18:22:13.629 [ERROR] [org.gradle.BuildExceptionReporter]
18:22:13.629 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
18:22:13.630 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':masoko:clean'.
18:22:13.631 [ERROR] [org.gradle.BuildExceptionReporter] > groovy/lang/GroovyObject
18:22:13.632 [ERROR] [org.gradle.BuildExceptionReporter]
18:22:13.632 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
18:22:13.632 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':masoko:clean'.
18:22:13.632 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
18:22:13.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
18:22:13.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
18:22:13.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
18:22:13.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200)
18:22:13.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172)
18:22:13.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
18:22:13.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111)
18:22:13.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
18:22:13.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
18:22:13.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
18:22:13.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
18:22:13.641 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
18:22:13.642 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
18:22:13.642 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
18:22:13.642 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
18:22:13.642 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
18:22:13.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103)
18:22:13.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
18:22:13.645 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
18:22:13.646 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
18:22:13.646 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
18:22:13.646 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
18:22:13.646 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
18:22:13.647 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31)
18:22:13.648 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20)
18:22:13.648 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:48)
18:22:13.648 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45)
18:22:13.648 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:39)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.oldFindClass(RootLoader.java:143)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.loadClass(RootLoader.java:115)
18:22:13.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.GrailsLauncher.<init>(GrailsLauncher.java:70)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask.createLauncher(GrailsTask.groovy:107)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask.executeCommand(GrailsTask.groovy:56)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask_Decorated.invokeMethod(Unknown Source)
18:22:13.650 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
18:22:13.651 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150)
18:22:13.651 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145)
18:22:13.651 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:477)
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:466)
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] ... 53 more
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.findClass(RootLoader.java:147)
18:22:13.652 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.loadClass(RootLoader.java:119)
18:22:13.653 [ERROR] [org.gradle.BuildExceptionReporter] ... 68 more
18:22:13.653 [ERROR] [org.gradle.BuildExceptionReporter]



 Comments   
Comment by René Gröschke (Inactive) [ 07/May/12 ]

What version of grails, and what version of the grails-gradle-plugin do you use?

Comment by Steve Holmes [ 07/May/12 ]

I'm using grails 2.0.1 and I'm not certain of the version of the grails-gradle plugin but I think it was 1.1.1-SNAPSHOT. It was the latest version when I filed the bug but I just noticed that Graeme Rocher made some changes 5 days ago and I don't know if I was using those changes. It doesn't look like the version was incremented.

Comment by René Gröschke (Inactive) [ 13/May/12 ]

Hello Steve,
I'm not able to reproduce this issue on my machine. Can you create a small selfcontained example that demoes this problem. You can attach your snippet to this issue report.

regards,
René

Comment by Dror Bereznitsky [ 13/Jun/12 ]

I also get the same exception when using version 1.1.0 of the grails-gradle plugin

Comment by Aaron Long [ 29/Jun/12 ]

I have a build.gradle using 1.1.1-SNAPSHOT which is failing with the same error. The weird thing is that some commands work and others don't. For instance, running "gradlew grails-test-app" works fine. But running "gradlew grails-war" fails with the above error.

Here is my build.gradle for reference. I'm running on Windows 7, 64-bit with JVM 1.7.0_05. I'm using the gradlew wrapper version 1.0 final.

buildscript {
    repositories {
        maven {
            url "http://repo.grails.org/grails/core/"
        }
    }

    dependencies {
        classpath "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT", "org.grails:grails-bootstrap:${grailsVersion}"
    }
}

apply plugin: "groovy"
apply plugin: "grails"

repositories {
    mavenCentral()
    maven {
        url "http://repo.grails.org/grails/core/"
    }
}

dependencies {
    groovy localGroovy()
    compile "org.grails:grails:${grailsVersion}",
            "org.grails:grails-core:${grailsVersion}",
            "org.grails:grails-crud:${grailsVersion}",
            "org.grails:grails-hibernate:${grailsVersion}",
            "org.grails:grails-logging:${grailsVersion}",
            "org.grails:grails-plugin-controllers:${grailsVersion}",
            "org.grails:grails-plugin-services:${grailsVersion}",
            "org.grails:grails-plugin-domain-class:${grailsVersion}",
            "org.grails:grails-plugin-datasource:${grailsVersion}",
            "org.grails:grails-plugin-i18n:${grailsVersion}"
}
Comment by Aaron Long [ 29/Jun/12 ]

Just to confirm, I get the same behavior running the gradle wrapper and gradle.

Comment by Scott [ 13/Jul/12 ]

I also have precisely the same issue, except that no commands work at all. "test" also fails, along with all "grails-..." commands. This is using gradle directly without a wrapper.

Comment by Richard Dunn [ 17/Jul/12 ]

I was able to build the project just fine, but I get the same error attempting to run the program. Mac OS X, 10.7.4. I am running gradle:

------------------------------------------------------------
Gradle 1.0
------------------------------------------------------------

Gradle build time: Tuesday, June 12, 2012 12:56:21 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_33 (Apple Inc. 20.8-b03-424)
OS: Mac OS X 10.7.4 x86_64

Comment by Martin Stockhammer [ 31/Jul/12 ]

I have the same issue on Linux

Comment by john hedden [ 08/Aug/12 ]

ditto for me. config:

------------------------------------------------------------
Gradle 1.0
------------------------------------------------------------

Gradle build time: Tuesday, June 12, 2012 12:56:21 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_33 (Apple Inc. 20.8-b03-424)
OS: Mac OS X 10.7.4 x86_64

works with grails 2.0.0 but not with 2.1.0. anyone know of a work around for this?

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:17:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.