Details

    • Sub-task
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • build-system
    • None
    • OSX Darwin 17.3.0

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              iemejia Ismaël Mejía
              cheister Chris Heisterkamp
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: