[GRADLE-2836] Sporadic java.lang.LinkageError: duplicate class definition when using --parallel Created: 12/Jul/13  Updated: 16/Jul/13  Resolved: 16/Jul/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.7-rc-1
Fix Version/s: 1.7-rc-2

Type: Bug
Reporter: Luke Daley Assignee: Luke Daley
Resolution: Fixed Votes: 0


 Description   

Error message looks something like:

Execution failed for task ':c:jar'.
> Could not generate a proxy class for class org.gradle.api.internal.file.copy.DefaultFileCopyDetails.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':c:jar'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:286)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:86)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:72)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTaskWithCacheLock(AbstractTaskPlanExecutor.java:64)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:54)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class org.gradle.api.internal.file.copy.DefaultFileCopyDetails.
    at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:201)
    at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
    at org.gradle.api.internal.file.copy.CopySpecVisitorDriver$1.visitFile(CopySpecVisitorDriver.java:47)
    at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree$1.visitFile(AbstractFileTree.java:145)
    at org.gradle.api.internal.file.collections.MapFileTree$Visit.visit(MapFileTree.java:103)
    at org.gradle.api.internal.file.collections.MapFileTree.visit(MapFileTree.java:70)
    at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)
    at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree.visit(AbstractFileTree.java:136)
    at org.gradle.api.internal.file.CompositeFileTree.visit(CompositeFileTree.java:54)
    at org.gradle.api.internal.file.copy.CopySpecVisitorDriver.visit(CopySpecVisitorDriver.java:41)
    at org.gradle.api.internal.file.copy.CopyActionImpl.execute(CopyActionImpl.java:72)
    at org.gradle.api.tasks.AbstractCopyTask.copy(AbstractCopyTask.java:42)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.api.tasks.bundling.Jar_Decorated.invokeMethod(Unknown Source)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.api.tasks.bundling.Jar_Decorated.invokeMethod(Unknown Source)
    at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:213)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:202)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 14 more
Caused by: org.gradle.api.GradleException: Could not call ClassLoader.defineClass() on org.gradle.util.MutableURLClassLoader@1e97676
    at org.gradle.util.JavaMethod.invoke(JavaMethod.java:69)
    at org.gradle.api.internal.AsmBackedClassGenerator$ClassBuilderImpl.generate(AsmBackedClassGenerator.java:838)
    at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:199)
    ... 41 more
Caused by: java.lang.LinkageError: duplicate class definition: org/gradle/api/internal/file/copy/DefaultFileCopyDetails_Decorated
    at org.gradle.util.JavaMethod.invoke(JavaMethod.java:62)
    ... 43 more

The problem is that the class generator has static state that is not thread safe.


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