You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Chris Heisterkamp (JIRA)" <ji...@apache.org> on 2018/01/08 17:27:00 UTC

[jira] [Commented] (BEAM-3422) The jar files uploaded to maven do not work with Java 9

    [ https://issues.apache.org/jira/browse/BEAM-3422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16316628#comment-16316628 ] 

Chris Heisterkamp commented on BEAM-3422:
-----------------------------------------

So far it looks like Oracle doesn't want to fix this issue until Java 10.  https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8194730

In the meantime, even if Beam doesn't support Java 9 yet it should probably still generate valid jar files. (Granted that all previous versions of the JDK were not so strict about modified dates in zip files and you could argue they were valid because they worked).

Could the reproducible builds plugin just be updated to use the date when the plugin is run?  Or just set it to the 1979-11-30 equivalent date? 

> The jar files uploaded to maven do not work with Java 9
> -------------------------------------------------------
>
>                 Key: BEAM-3422
>                 URL: https://issues.apache.org/jira/browse/BEAM-3422
>             Project: Beam
>          Issue Type: Sub-task
>          Components: build-system
>    Affects Versions: 2.2.0
>         Environment: OSX Darwin 17.3.0
>            Reporter: Chris Heisterkamp
>             Fix For: Not applicable
>
>
> The apache beam jars uploaded to maven have invalid date modified times in the jar files and cannot be loaded by JDK 9 because of https://bugs.openjdk.java.net/browse/JDK-8184940.  I've submitted a new bug to http://bugreport.java.com asking that the fix be back ported to the next Java 9 release.
> In the meantime, can you repackage the jars with valid modified times? And uploaded fixed jars to Maven?
> To reproduce you just need to put one of the jars on the classpath for javac.  So far I've found the following jars on maven central are affected.
> beam-runners-google-cloud-dataflow-java-2.2.0.jar
> beam-sdks-common-runner-api-2.2.0.jar
> beam-sdks-java-core-2.2.0.jar
> beam-sdks-java-extensions-google-cloud-platform-core-2.2.0.jar
> beam-sdks-java-extensions-protobuf-2.2.0.jar
> beam-sdks-java-io-google-cloud-platform-2.2.0.jar
> e.g.
> ```
> > curl -O http://central.maven.org/maven2/org/apache/beam/beam-sdks-java-core/2.2.0/beam-sdks-java-core-2.2.0.jar
> > javac -cp beam-sdks-java-core-2.2.0.jar HelloWorld.java
> An exception has occurred in the compiler (9.0.1). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
> java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
> 	at java.base/java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
> 	at java.base/java.time.temporal.ChronoField.checkValidValue(ChronoField.java:714)
> 	at java.base/java.time.LocalDate.of(LocalDate.java:269)
> 	at java.base/java.time.LocalDateTime.of(LocalDateTime.java:336)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipUtils.dosToJavaTime(ZipUtils.java:109)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.cen(ZipFileSystem.java:1950)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.readCEN(ZipFileSystem.java:1937)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getEntry(ZipFileSystem.java:1324)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.newInputStream(ZipFileSystem.java:550)
> 	at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.isMultiReleaseJar(JarFileSystem.java:91)
> 	at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:67)
> 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:134)
> 	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:517)
> 	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319)
> 	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715)
> 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722)
> 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:648)
> 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:529)
> 	at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293)
> 	at jdk.compiler/com.sun.tools.javac.code.Symtab.lambda$addRootPackageFor$7(Symtab.java:758)
> 	at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
> 	at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:354)
> 	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)
> 	at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285)
> 	at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300)
> 	at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570)
> 	at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554)
> 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052)
> 	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923)
> 	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:302)
> 	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:162)
> 	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
> 	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
> > java -version
> java version "9.0.1"
> Java(TM) SE Runtime Environment (build 9.0.1+11)
> Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
> ```
> Unpacking and re-creating the jar with JDK 8 fixes the problem on OSX
> jar -xf beam-sdks-java-core-2.2.0.jar
> jar -cf beam-sdks-java-core-2.2.0.jar .
> You call also use the JarTime.java test from https://bugs.openjdk.java.net/browse/JDK-8184940 to look at the modified dates for the jar entries.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)