Intermittent StackOverflow errors during AEMaaCS pipeline build

A StackOverflowError occurs during the build phase in Adobe Experience Manager as a Cloud Service (AEMaaCS), caused by inconsistent dependency resolution across cloud providers. To fix this, verify pom.xml configurations, fix HTL script issues, inspect repository access, and apply a temporary workaround using cached dependencies.

Description description

Environment

Adobe Experience Manager as a Cloud Service (AEMaaCS) – Sites

Issue/Symptoms

  • Pipeline builds intermittently fail with the error: Exception in thread ‘main’ java.lang.StackOverflowError.
  • Some builds succeed, while others fail without pulling required dependencies.
  • Logs show Maven skips fetching dependencies from the repository during failed builds.

Cause

Cloud Manager builds client code using two cloud providers in parallel, stopping one when the other completes. Only one provider uses caching, so some builds reuse dependencies while others must fetch them. When dependencies are missing and recursive logic (for example, in HTL scripts) is triggered, it can lead to StackOverflowError. This typically results from how dependencies are managed on the customer side.

Resolution resolution

To fix StackOverflow errors during AEM QA builds, follow these steps:

  1. Verify dependency configuration by reviewing all pom.xml files across submodules. Ensure that Maven repository settings are correct and the required dependency (gs4tr-globallink-adaptors-aem.all) is properly defined and accessible. If the dependency is unavailable, add it to a local library folder and reference it in the pom.xml using the systemPath scope.
  2. Inspect repository access by configuring credentials for accessing private repositories in Maven settings.xml, and setting the required environment variables (for example, MAVEN_GLOBAL_LINK_PASSWORD) correctly.
  3. Inspect repository access by configuring credentials for private repositories in the Maven settings.xml file. Ensure that required environment variables (for example, MAVEN_GLOBAL_LINK_PASSWORD) are set correctly.
  4. Check pipeline logs for missing dependencies, incorrect repository URLs, or 404 errors when retrieving dependencies from specified repositories.
  5. Retry failed pipelines as a temporary workaround. Successful runs may use cached dependencies until a permanent fix is implemented.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f