I have had several issues running clean in combination with other gradle
commands - I think because of our parallel build. Maybe do this?

$ ./gradlew clean; ./gradlew build -xtest

On Tue, Mar 26, 2019 at 10:43 AM Kirk Lund <kl...@apache.org> wrote:

> Intermittent build error caused by spotlessJava. My checkout of Geode
> intermittently gets into a state that then fails to build. I've been seeing
> this come and go for the last month or two. I'm not sure what puts it into
> this state but executing:
>
> $ ./gradlew clean build -x test
>
> ...will repeatedly fail in junit:spotlessJava with a
> java.lang.reflect.InvocationTargetException and a root cause of
> ava.lang.NoClassDefFoundError:
> org/openjdk/tools/javac/comp/InferenceContext.
>
> Stopping the gradle daemon(s) does not clear the problem up. Cleaning does
> not clear it up. Changing JDK version does not clear it up. But I just
> discovered this morning that if I attempt to execute spotless directly that
> finally clears it up:
>
> $ ./gradlew spotlessApply
> or
> $ ./gradlew spotlessCheck
>
> After either spotlessApply or spotlessCheck, the build will stop failing
> when I execute:
>
> $ ./gradlew clean build -x test
>
> The stack thrown by spotlessJava and printed by gradle when it's stuck in
> this state is below...
>
> > Task :geode-junit:spotlessJava FAILED
> Step 'removeUnusedImports' found problem in
>
> 'geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/DebuggableCommand.java':
> null
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at
>
> com.diffplug.spotless.java.GoogleJavaFormatStep$State.lambda$createRemoveUnusedImportsOnly$1(GoogleJavaFormatStep.java:153)
>         at
>
> com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:78)
>         at
> com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:76)
>         at com.diffplug.spotless.Formatter.compute(Formatter.java:230)
>         at com.diffplug.spotless.Formatter.isClean(Formatter.java:167)
>         at
> com.diffplug.gradle.spotless.SpotlessTask.check(SpotlessTask.java:263)
>         at
>
> com.diffplug.gradle.spotless.SpotlessTask.performAction(SpotlessTask.java:205)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at
> org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
>         at
>
> org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:73)
>         at
>
> org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
>         at
>
> org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$4.run(ExecuteActionsTaskExecuter.java:338)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
>         at
>
> org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:327)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:312)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:75)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:158)
>         at
>
> org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:46)
>         at
>
> org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
>         at
>
> org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
>         at
>
> org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
>         at
>
> org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
>         at
>
> org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:49)
>         at
>
> org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:42)
>         at
>
> org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:28)
>         at
>
> org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:133)
>         at
>
> org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$5(CacheStep.java:83)
>         at java.util.Optional.orElseGet(Optional.java:267)
>         at
>
> org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
>         at
>
> org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:37)
>         at
>
> org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
>         at
>
> org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
>         at
>
> org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
>         at
>
> org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:95)
>         at
>
> org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:88)
>         at java.util.Optional.map(Optional.java:215)
>         at
>
> org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
>         at
>
> org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
>         at
>
> org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
>         at
>
> org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:109)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveIncrementalChangesTaskExecuter.execute(ResolveIncrementalChangesTaskExecuter.java:84)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
>         at
>
> org.gradle.api.internal.tasks.execution.FinishSnapshotTaskInputsBuildOperationTaskExecuter.execute(FinishSnapshotTaskInputsBuildOperationTaskExecuter.java:51)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:102)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:74)
>         at
>
> org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
>         at
>
> org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:109)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
>         at
>
> org.gradle.api.internal.tasks.execution.StartSnapshotTaskInputsBuildOperationTaskExecuter.execute(StartSnapshotTaskInputsBuildOperationTaskExecuter.java:52)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
>         at
>
> org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
>         at
>
> org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
>         at
>
> org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:94)
>         at
>
> org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
>         at
>
> org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
>         at
>
> org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
>         at
>
> org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:63)
>         at
>
> org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
>         at
>
> org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:46)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
>         at
>
> org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
>         at
>
> org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
>         at
>
> org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
>         at
>
> org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
>         at
>
> org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
>         at
>
> org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
>         at
>
> org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
>         at
>
> org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
>         at
>
> org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
>         at
>
> org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
>         at
>
> org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
>         at
>
> org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
>         at
>
> org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
>         at
>
> org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
>         at
>
> org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at
>
> org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.NoClassDefFoundError:
> org/openjdk/tools/javac/comp/InferenceContext
>         at org.openjdk.tools.javac.comp.Infer.<init>(Infer.java:121)
>         at org.openjdk.tools.javac.comp.Infer.instance(Infer.java:101)
>         at org.openjdk.tools.javac.comp.Check.<init>(Check.java:120)
>         at org.openjdk.tools.javac.comp.Check.instance(Check.java:104)
>         at
> org.openjdk.tools.javac.comp.DeferredAttr.<init>(DeferredAttr.java:107)
>         at
> org.openjdk.tools.javac.comp.DeferredAttr.instance(DeferredAttr.java:99)
>         at org.openjdk.tools.javac.comp.Resolve.<init>(Resolve.java:123)
>         at org.openjdk.tools.javac.comp.Resolve.instance(Resolve.java:159)
>         at org.openjdk.tools.javac.comp.Attr.<init>(Attr.java:129)
>         at org.openjdk.tools.javac.comp.Attr.instance(Attr.java:119)
>         at org.openjdk.tools.javac.comp.Annotate.<init>(Annotate.java:102)
>         at org.openjdk.tools.javac.comp.Annotate.instance(Annotate.java:77)
>         at
> org.openjdk.tools.javac.jvm.ClassReader.<init>(ClassReader.java:232)
>         at
> org.openjdk.tools.javac.jvm.ClassReader.instance(ClassReader.java:225)
>         at
> org.openjdk.tools.javac.code.ClassFinder.<init>(ClassFinder.java:183)
>         at
> org.openjdk.tools.javac.code.ClassFinder.instance(ClassFinder.java:176)
>         at org.openjdk.tools.javac.code.Symtab.<init>(Symtab.java:453)
>         at org.openjdk.tools.javac.code.Symtab.instance(Symtab.java:88)
>         at org.openjdk.tools.javac.tree.TreeMaker.<init>(TreeMaker.java:87)
>         at
> org.openjdk.tools.javac.tree.TreeMaker.instance(TreeMaker.java:60)
>         at
> org.openjdk.tools.javac.parser.ParserFactory.<init>(ParserFactory.java:72)
>         at
>
> org.openjdk.tools.javac.parser.ParserFactory.instance(ParserFactory.java:54)
>         at
>
> com.google.googlejavaformat.java.RemoveUnusedImports.parse(RemoveUnusedImports.java:243)
>         at
>
> com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:212)
>         at
>
> com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:205)
>         ... 97 more
>

Reply via email to