AEM Sites: Deprecated org.apache.sling.commons.json.JSONObject warning when using PageInfoProvider for custom columns

This article explains the cause and current impact of deprecated API warnings related to org.apache.sling.commons.json.JSONObject when customizing AEM Sites list view columns using PageInfoProvider.

Description description

Environment

Adobe Experience Manager (AEM) as a Cloud Service (all versions)

Issue/Symptoms

When implementing custom columns in the AEM Sites console list view using the PageInfoProvider interface, the following warning appears in the logs:

2023-02-23 18:47:55.095 [ region-deprecated-api]  com.xx.aem:xx-unified-site.core:0.0.2-SNAPSHOT: Usage of deprecated package found : org.apache.sling.commons.json : Usage of this deprecated API is not supported in AEM as a Cloud Service. Deprecated since 2022-12-31 For removal : 2027-12-31 (com.xx.aem:xx-unified-site.all:0.0.2-SNAPSHOT)
  • The warning is triggered because the PageInfoProvider API contract requires returning a org.apache.sling.commons.json.JSONObject.
  • The org.apache.sling.commons.json package is deprecated and scheduled for removal after 2027-12-31.
  • These warnings are informational and don’t currently block Cloud Manager pipelines when the usage is limited to PageInfoProvider implementations.

Cause

The PageInfoProvider interface currently requires returning a org.apache.sling.commons.json.JSONObject, which forces the use of a deprecated package. This is considered technical debt and will be addressed in a future AEM Sites API update.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the log warnings to confirm they’re related to the use of PageInfoProvider and the org.apache.sling.commons.json.JSONObject dependency.

  2. Understand that currently these warnings are informational only and don’t block deployments or affect the functionality of custom columns in the Sites console.

  3. Monitor Adobe Experience Manager release notes and documentation for updates regarding the deprecation and planned removal of org.apache.sling.commons.json.

  4. Plan to refactor custom column implementations in the future:

    • Adobe engineering is working on deprecating the current PageInfoProvider interface.
    • A new interface that doesn’t require org.apache.sling.commons.json will be introduced and documented in a future release.
  5. No immediate action is required unless the deprecated API is used outside of the PageInfoProvider context, or if future releases introduce breaking changes.

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