Noob question: Gradle and missing tools

issue-resolved

(Erik Berglund) #1

I just started using Gradle and immediately hit a roadblock:
My project compiles fine, but when I execute ‘gradle test’ I get a huge wall of text.
It’s the same error, repeated over and over again:

Could not open cache directory workerMain (/home/erikjber/.gradle/caches/2.13/workerMain).
org.gradle.cache.CacheOpenException: Could not open cache directory workerMain (/home/erikjber/.gradle/caches/2.13/workerMain).
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:48)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:28)
at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:80)
at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:50)
at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:138)
at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:121)
at org.gradle.process.internal.child.WorkerProcessClassPathProvider.findClassPath(WorkerProcessClassPathProvider.java:73)
at org.gradle.api.internal.DefaultClassPathRegistry.getClassPath(DefaultClassPathRegistry.java:34)
at org.gradle.process.internal.child.ApplicationClassesInSystemClassLoaderWorkerFactory.prepareJavaCommand(ApplicationClassesInSystemClassLoaderWorkerFactory.java:76)
at org.gradle.process.internal.DefaultWorkerProcessBuilder.build(DefaultWorkerProcessBuilder.java:158)
at org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.forkProcess(ForkingTestClassProcessor.java:78)
at org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.processTestClass(ForkingTestClassProcessor.java:64)
at org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor.processTestClass(RestartEveryNTestClassProcessor.java:47)
at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:29)
at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)
at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: com/tonicsystems/jarjar/asm/commons/SignatureRemapper
at com.tonicsystems.jarjar.MainProcessor.<init>(MainProcessor.java:46)
at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:48)
at org.gradle.util.AntUtil.execute(AntUtil.java:43)
at org.gradle.process.internal.child.WorkerProcessClassPathProvider$CacheInitializer.execute(WorkerProcessClassPathProvider.java:190)
at org.gradle.process.internal.child.WorkerProcessClassPathProvider$CacheInitializer.execute(WorkerProcessClassPathProvider.java:103)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$Initializer.initialize(DefaultPersistentDirectoryCache.java:96)
at org.gradle.cache.internal.DefaultCacheAccess$2.run(DefaultCacheAccess.java:104)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:173)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:163)
at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:102)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:46)
... 26 more
Caused by: java.lang.ClassNotFoundException: com.tonicsystems.jarjar.asm.commons.SignatureRemapper
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

The directory /home/erikjber/.gradle/caches/2.13/workerMain exists and is read/writeable by the current user.
Dropping the jarjar-1.4.jar file into /home/erikjber/.gradle/caches/2.13/workerMain does not resolve the issue.

Any pointers?


(Erik Berglund) #2

Turns out gradle 2.13 is really old, and the problem was solved by updating to gradle 3.2.