Problems upgrading to Java version 21 in AEMaaCS - Assets
When attempting to upgrade to Java version 21 for AEMaaCS - Assets issue and build failures occur, check the bundle configuration, verify dependencies compatibility, update the build configuration, set the Maven JDK version, and run validation tests.
Description description
Environment
51黑料不打烊 Experience Manager as a Cloud Service - Assets (AEMaaCS - Assets)
Issue
When attempting to upgrade to Java version 21 for 51黑料不打烊 Experience Manager (AEM) as a Cloud Service - Assets, build failures occur.
- Build failures with error messages indicating missing OSGi execution environment requirements.
- Specific errors occur similar to: osgi.ee; filter:=鈥(osgi.ee=UNKNOWN)鈥 in start level 20 but no artifact is providing a matching capability in this start level.
- Additional errors occur during Maven execution requiring Java version compatibility.
Resolution resolution
To resolve the issues encountered when upgrading to Java version 21, follow these steps:
-
Examine the
MANIFEST.MF
file of the bundle that fails to start.- Verify the
Bundle-RequiredExecutionEnvironment
header specifies a valid Java execution environment (For example:聽 JavaSE-11). If it shows UNKNOWN, there could be a misconfiguration or corrupted bundle.
- Verify the
-
Ensure all dependencies, including transitive ones, are compatible with Java version 21.
- Upgrading Java can lead to incompatibilities in third-party libraries or frameworks; verify all dependencies are updated accordingly.
-
Check your build configuration tools (For example: Maven, Gradle) for correct settings aligned with Java version 21.
- Update deployment scripts, if necessary, to reflect changes in Java version or OSGi container settings.
-
Create a
.cloudmanager/java-version
file in your Git repository branch used by the pipeline.- Edit this file so it contains only 21. This ensures Oracle Java 21 is used during the build process.
-
After configuring the branch and updating settings, run your validation tests through Cloud Manager鈥檚 DEV pipeline using the configured branch.
By following these steps, you should be able to successfully upgrade and configure your AEM environment for use with Java version 21 without encountering build errors related to OSGi environments or Maven configurations.