Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure with parallel builds - java.nio.file.ClosedFileSystemException #1401

Closed
Zardoz89 opened this issue Oct 3, 2022 · 8 comments
Labels

Comments

@Zardoz89
Copy link

Zardoz89 commented Oct 3, 2022

Looks that groorvy-eclipse-compiler isn't thread safe when maven it's being launched with Java 11 (or more modern version of java. Weirdly with Java 8, this not happens)

Executing this : mvn clean verify -Dmaven.javadoc.skip=true -T2 with

mvn -version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.16, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: es_ES, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-48-generic", arch: "amd64", family: "unix"

Gives this error ALWAYS on nearly all multi-module projects that I try:

[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ digilog-logback ---
[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] java.nio.file.ClosedFileSystemException
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1155)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.checkAccess(ZipFileSystem.java:367)
        at jdk.zipfs/jdk.nio.zipfs.ZipPath.checkAccess(ZipPath.java:843)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.checkAccess(ZipFileSystemProvider.java:185)
        at java.base/java.nio.file.Files.exists(Files.java:2440)
        at org.eclipse.jdt.internal.compiler.batch.ClasspathJep247.findClass(ClasspathJep247.java:84)
        at org.eclipse.jdt.internal.compiler.batch.FileSystem.internalFindClass(FileSystem.java:472)
        at org.eclipse.jdt.internal.compiler.batch.FileSystem.findClass(FileSystem.java:414)
        at org.eclipse.jdt.internal.compiler.batch.FileSystem.findType(FileSystem.java:564)
        at org.eclipse.jdt.internal.compiler.env.IModuleAwareNameEnvironment.findType(IModuleAwareNameEnvironment.java:101)
        at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:301)
        at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:276)
        at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:626)
        at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:707)
        at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:521)
        at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:600)
        at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:907)
        at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145)
        at java.base/java.lang.Thread.run(Thread.java:829)
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/luis/repos/work/java/librerias/digilog/digilog-log4j/src/main/java/com/digibis/commons/util/ANSIConsoleAppender.java: 
1. ERROR in /home/luis/repos/work/java/librerias/digilog/digilog-log4j/src/main/java/com/digibis/commons/util/ANSIConsoleAppender.java (at line 0)
        /*
        ^
Internal compiler error: java.nio.file.ClosedFileSystemException at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1155)
[ERROR] Found 1 error and 0 warnings.
[INFO] 2 errors 

Looks that it's related to this issue on Tycho #/tycho/issues/183 and on JDT compiler, that (If I read correctly) was fixed. Ithink that groovy-eclipse-compiler should update Tycho ASAP to fix this annoying problem :

@eric-milles
Copy link
Member

What version of groovy-eclipse-batch are you using? There are newer versions based on JDT that contains the patch.

@Zardoz89
Copy link
Author

Zardoz89 commented Oct 3, 2022

2.5.14-02
But also, I try with 3.0.8-01 with the same problem

I don't see any newer version beyond these two

@eric-milles
Copy link
Member

Current for 2.5 is 2.5.18-01 and for 3.0 it's 3.0.13-02 -- https://groovy.jfrog.io/ui/native/plugins-release-local/org/codehaus/groovy/groovy-eclipse-batch

@Zardoz89
Copy link
Author

Zardoz89 commented Oct 3, 2022

Maven central and maven respository aren't update
https://central.sonatype.dev/artifact/org.codehaus.groovy/groovy-eclipse-batch/3.0.8-01/versions
https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch


Ok... our code base have some years, and we graved groovy-eclipse-compile from maven central. Simply, we didn't know that groovy-eclipse-compiler mirrored on maven central, isn't being update that we should use another maven repository to grab it.

@eric-milles
Copy link
Member

I had a path to Maven Central though Bintray. When that was shut down, I was left with roll-your-own from Artifactory. To date I have not taken on that work. #1359

@Zardoz89
Copy link
Author

Zardoz89 commented Oct 3, 2022

With version 3.0.13-0 this problem is fixed. However with 2.5.18-01 keeps happening.
I would use this to do the final push to move us to use Groovy 3 by default ASAP :P

@eric-milles
Copy link
Member

eric-milles commented Oct 3, 2022

Is that "3.0.13-02"? "01" is built against Eclipse 4.19 (for Java 8 compat) and "02" is build against latest release at the time, which is 4.25 for 3.0.13. You can check this in the manifest of the jar. I'll see about backporting the ClasspathJep247 fix to 4.19 and then you'll get it as part of 2.5.19-01.

@Zardoz89
Copy link
Author

Zardoz89 commented Oct 3, 2022

Is that "3.0.13-02"?

Yes

I'll see about backporting the ClasspathJep247 fix to 4.19 and then you'll get it as part of 2.5.19-01.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants