Resolve blank Letters preview in AEM 6.5 LTS on Java 17 or 21

This article describes how to resolve an issue where the Letters preview in AEM Forms appears blank after migrating to AEM 6.5 LTS and running on Java 17 or 21. The solution involves updating JVM options to allow necessary module access.

Description description

Environment

  • Adobe Experience Manager (AEM) 6.5 LTS
  • Java 17 or Java 21

Issue/Symptoms

When previewing letter templates in the Create Correspondence interface, the screen appears blank. This issue does not affect Forms or Documents previews and was not present on Java 8 or 11. Server logs may show errors such as java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.util.NavigableMap java.util.TreeSet.m accessible: module java.base does not "opens java.util" to unnamed module.

Cause

Starting with Java 17, strong module encapsulation restricts reflective access required by the Correspondence Management module, resulting in the blank preview.

Resolution resolution

To fix the blank Letters preview issue, follow these steps:

  1. Locate the script or configuration file that sets JVM options for your AEM Windows service. For Windows installations, this is typically the instsrv.bat file in your AEM installation directory.

  2. Open the file and find the line that sets JVM options (often starting with set jvm_options=). Options are usually separated by # characters.

  3. Add the following JVM argument to the options list: --add-opens=java.base/java.util=ALL-UNNAMED

    • Example: set jvm_options=-Xmx2048m#--add-opens=java.base/java.util=ALL-UNNAMED#
  4. Save the changes to the file.

  5. Reinstall the AEM Windows service to apply the updated JVM options:

    1. Open an Administrator command prompt and navigate to the directory containing the service scripts.
    2. Stop the AEM service using: net stop [ YourAEMServiceName]
    3. Uninstall the service: instsrv.bat -uninstall [ YourAEMServiceName]
    4. Reinstall the service: instsrv.bat [ YourAEMServiceName]
    5. Start the service: net start [ YourAEMServiceName]
  6. After the service restarts, log in to AEM and attempt to preview a letter in the Create Correspondence interface. The letter should now render correctly.

  7. (Recommended) Review Adobe’s official documentation for the full set of recommended Java 21 --add-opens options for AEM 6.5 LTS to ensure compatibility with all features.

recommendation-more-help
experience-cloud-kcs-help-kbarticles