Could not calculate the signature for Jar file icu4j


(Trung Vo) #1

Hi everyone,

I just tested 3.4-rc-1 out and I got this exception, any idea on this?

14:21:05.046 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Task worker,5,main]] finished, busy: 4.75 secs, idle: 0.007 secs
14:21:05.048 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
14:21:05.048 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:21:05.048 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Failed to capture snapshot of input files for task 'compileJava' property 'classpath' during up-to-date check.
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not calculate the signature for Jar file /home/tvo/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j/2.6.1/ec0b2437fa48825d7b046efafbe8d27343fe97b2/icu4j-2.6.1.jar
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
14:21:05.049 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task 'compileJava' property 'classpath' during up-to-date check.
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:89)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.<init>(AbstractNamedFileSnapshotTaskStateChanges.java:54)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.rules.InputFilesTaskStateChanges.<init>(InputFilesTaskStateChanges.java:28)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:55)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:164)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:79)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:51)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
14:21:05.050 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.api.UncheckedIOException: Could not calculate the signature for Jar file /home/tvo/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j/2.6.1/ec0b2437fa48825d7b046efafbe8d27343fe97b2/icu4j-2.6.1.jar
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.JvmClassHasher.hashJarFile(JvmClassHasher.java:115)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.DefaultCompileClasspathSnapshotter.normaliseFileElement(DefaultCompileClasspathSnapshotter.java:72)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitCollection(AbstractFileCollectionSnapshotter.java:144)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.file.AbstractFileCollection.visitRootElements(AbstractFileCollection.java:234)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:71)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:87)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   ... 24 more
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.api.UncheckedIOException: Could not calculate the signature for class file com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.JvmClassHasher.visit(JvmClassHasher.java:137)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.JvmClassHasher.hashJarFile(JvmClassHasher.java:112)
14:21:05.051 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   ... 30 more
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.ArrayIndexOutOfBoundsException: 48188
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.objectweb.asm.ClassReader.readClass(Unknown Source)
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.objectweb.asm.ClassReader.getClassName(Unknown Source)
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.compile.ApiClassExtractor.shouldExtractApiClassFrom(ApiClassExtractor.java:62)
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.JvmClassHasher.hashClassBytes(JvmClassHasher.java:78)
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.JvmClassHasher.visit(JvmClassHasher.java:135)
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   ... 31 more
14:21:05.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
14:21:05.052 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
14:21:05.052 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED
14:21:05.052 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 
14:21:05.052 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 12.445 secs

Cheers,
Tony


Classpath snapshotting not working for icu4j in gradle 3.5
(Sterling Greene) #2

Does this work for you with 3.3?


(Trung Vo) #3

yes, It works for me in 3.3. When I upgraded to 3.4-rc-1, it consistently throws that exception


(Sterling Greene) #4

Thanks @ttrungvo

I raised https://github.com/gradle/gradle/issues/1305. We’ll see what we can do for another RC.


(idlsoft) #5

I’m having a very similar issue. A different jar, also started with 3.4-rc-1:

        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: org.gradle.api.UncheckedIOException: Could not calculate the signature for Jar file C:\Users\-----\.gradle\caches\modules-2\files-2.1\net.sf.ehcache\ehcac
7433b483b9d485fe\ehcache-2.6.0.pom
        at org.gradle.api.internal.changedetection.state.JvmClassHasher.hashJarFile(JvmClassHasher.java:115)
        at org.gradle.api.internal.changedetection.state.DefaultCompileClasspathSnapshotter.normaliseFileElement(DefaultCompileClasspathSnapshotter.java:72)
        at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitCollection(AbstractFileCollectionSnapshotter.
        at org.gradle.api.internal.file.AbstractFileCollection.visitRootElements(AbstractFileCollection.java:234)
        at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
        at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:71)
        at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:87)
        ... 74 more
Caused by: java.util.zip.ZipException: error in opening zip file
        at org.gradle.api.internal.changedetection.state.JvmClassHasher.hashJarFile(JvmClassHasher.java:101)
        ... 80 more

(Stefan Oehme) #6

@CedricChampeau looks like we are not checking the file extension before we hash jar files


(Cédric Champeau) #7

Indeed there’s no check and we assume that everything on compile classpath is a compile classpath element. This is obviously not the case here (a pom.xml file is not a classpath element relevant to compilation). @idlsoft do you happen to know how you end up with such a file on compile classpath? We’re discussing if we need to fix this in rc3 right now.


(Stefan Oehme) #8

I think this is pretty common, e.g. when one Maven project depends on a metadata-only Maven project which is only there to pull in more transitive dependencies. I think the pom is the main artifact in that case and will be included on the compile classpath by dependency resolution.


(idlsoft) #9

I found this in one of our external dependencies:
<dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>2.6.0</version> <type>pom</type> </dependency>
No idea why, but it’s not new, and we don’t have much control over it.
I did a little experiment - created a project with only that dependency.
3.4-rc-2 failed, 3.2 built fine.


(Cédric Champeau) #10

@idlsoft The fix is now on the release branch, it will ship with rc3. Thanks for reporting!


(idlsoft) #11

I’m not sure what that code does exactly, but does it make sense to also include .zip files?


(Trung Vo) #12

I just tried gradle-3.4-rc-3 and it seems to work for me. Thank you very much everyone.


(Santosh Gokak) #13

I see this with grad;e 3.5 on the same jar.How can i fix this without changing dependency?


Gradle 3.5

Build time: 2017-04-10 13:37:25 UTC
Revision: b762622a185d59ce0cfc9cbc6ab5dd22469e18a6

Groovy: 2.4.10
Ant: Apache Ant™ version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_121 (Oracle Corporation 25.121-b13)
OS: Linux 4.4.0-62-generic amd64

-Santosh