Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-60481

Hazelcast doesn't have proper access to required Java packages on Confluence Data Center when running on Java 11

    XMLWordPrintable

Details

    Description

      Issue Summary

      When starting a Confluence node with Java 11 on a Data Center deployment, the following warning appears in the application log:

      2020-11-12 18:31:58,355 WARN [Catalina-utility-2] [com.hazelcast.instance.HazelcastInstanceFactory] log Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
       --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
      



      The Hazelcast documentation recommends giving access to specific Java packages for better performance.

      It's unknown for now if this has any implications on Confluence features or performance.

      Steps to Reproduce

      1. Install a vanilla instance of Confluence Data Center.
      2. Configure the node to run with Java 11 (i.e. AdoptOpenJDK 11)
      3. Start a Confluence node.

      Expected Results

      Confluence starts with all required modules loaded and Hazelcast doesn't throw a warning about not being able to access some Java packages.

      Actual Results

      When loading Hazelcast, the following message is logged in atlassian-confluence.log:

      2020-11-12 18:31:58,355 WARN [Catalina-utility-2] [com.hazelcast.instance.HazelcastInstanceFactory] log Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
       --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
      

      Workaround

      Add the following entries to setenv.sh:

      JDK_JAVA_OPTIONS="--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED ${JDK_JAVA_OPTIONS}"
      JDK_JAVA_OPTIONS="--add-opens java.base/java.nio=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED ${JDK_JAVA_OPTIONS}"
      JDK_JAVA_OPTIONS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED ${JDK_JAVA_OPTIONS}"
      export JDK_JAVA_OPTIONS
      

      Attachments

        Issue Links

          Activity

            People

              5339cdd01cf4 Jeffery Xie
              tmasutti Thiago Masutti
              Votes:
              25 Vote for this issue
              Watchers:
              31 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: