Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8279675

CDS cannot handle non-existent JAR file in bootclassapth

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b07
    • CPU:
      x86_64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      FROM ubuntu:20.04

      A DESCRIPTION OF THE PROBLEM :
      I'm building a docker container based on Ubuntu using the openjdk-17-jre-headless package installed via apt.

      The Ubuntu package seems to have some sort of patch that adds /usr/share/java/java-atk-wrapper.jar to the boot class path. This file doesn't actually exist and thus has no effect. However, if I produce a *.jsa file with this JDK, then even though -XX:ArchiveClassesAtExit works just fine, a subsequent call with -XX:SharedArchiveFile then doesn't work (same JDK, same boot class path with same missing jar) and fails with "BOOT classpath mismatch, actual =/usr/lib/jvm/java-17-openjdk-amd64/lib/modules:/usr/share/java/java-atk-wrapper.jar".


      Console Output:


      ------------------------
      -XX:ArchiveClassesAtExit
      ------------------------

      #7 0.188 + FILEBOT_OPTS=-Xshare:on -XX:ArchiveClassesAtExit=/classes.jsa -Xlog:class+path=info filebot -script fn:sysenv
      #7 0.195 [0.001s][info][class,path] bootstrap loader class path=/usr/lib/jvm/java-17-openjdk-amd64/lib/modules:/usr/share/java/java-atk-wrapper.jar
      #7 0.199 [0.005s][info][class,path] Expecting BOOT path=/usr/lib/jvm/java-17-openjdk-amd64/lib/modules
      #7 0.199 [0.005s][info][class,path] Expecting -Djava.class.path=
      #7 0.199 [0.005s][info][class,path] checking shared classpath entry: /usr/lib/jvm/java-17-openjdk-amd64/lib/modules
      #7 0.199 [0.005s][info][class,path] ok
      #7 0.200 [0.006s][info][class,path] app loader class path=/usr/share/filebot/jar/filebot.jar
      ...


      ------------------------
      -XX:SharedArchiveFile
      ------------------------
      #7 4.597 + FILEBOT_OPTS=-Xshare:on -XX:SharedArchiveFile=/classes.jsa -Xlog:class+path=info filebot -script fn:sysenv
      #7 4.608 [0.002s][info][class,path] bootstrap loader class path=/usr/lib/jvm/java-17-openjdk-amd64/lib/modules:/usr/share/java/java-atk-wrapper.jar
      #7 4.620 [0.012s][info][class,path] Expecting BOOT path=/usr/lib/jvm/java-17-openjdk-amd64/lib/modules
      #7 4.620 [0.012s][info][class,path] Expecting -Djava.class.path=
      #7 4.620 [0.012s][info][class,path] checking shared classpath entry: /usr/lib/jvm/java-17-openjdk-amd64/lib/modules
      #7 4.620 [0.012s][info][class,path] ok
      #7 4.620 [0.012s][info][class,path] Expecting BOOT path=/usr/lib/jvm/java-17-openjdk-amd64/lib/modules
      ...
      #7 4.634 [0.023s][info][class,path] [BOOT classpath mismatch, actual =/usr/lib/jvm/java-17-openjdk-amd64/lib/modules:/usr/share/java/java-atk-wrapper.jar
      #7 4.634 Error occurred during initialization of VM
      #7 4.634 Unable to use shared archive.
      ...

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If I use the same JDK, then I expect the generated *.jsa to work, even if the OpenJDK is somehow patched to include non-existent boot class path entries.

      CUSTOMER SUBMITTED WORKAROUND :
      The work around is to not use the openjdk-17-jre-headless package, and instead some other generic OpenJDK build.

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ccheung Calvin Cheung
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: