AEM 6.3 is the latest version of Adobe Experience Manager. While this new version comes with some great new features such as Content as a Service and Core WCM Components, it also deprecates some common functionalities. Two of the most common functionalities deprecated in AEM 6.3 are Apache Sling Commons JSON and Apache Felix SCR Annotations.
Apache Sling’s JSON library is used on many projects for simple JSON parsing and generation. Unfortunately, Apache’s legal team determined the basis for Apache Sling’s Commons JSON library, org.json has a unique license which is not compatible with the Apache 2.0 license used by Apache Sling. Thus, the library was deprecated and is now officially deprecated in AEM 6.3.
So what does this mean? Apache Sling Commons JSON is available in AEM 6.3 and will be available as a download from the Apache Sling website, but is no longer officially supported. If you are using the Apache Sling Commons JSON library in AEM 6.3 you should stop using it immediately and heavily consider removing any existing code to avoid future headaches.
So if Apache Sling Commons JSON is deprecated, what is the replacement? There are a few options:
The best option depends on your needs. Apache Johnzon is a good choice if you need a stable, open source library, but don’t need the full serialization options available in Gson. You will just need to install Apache Johnzon separately, but it’s simple to embed it into your code package.
org.json and Gson just work out of the box, however, they are tied to Adobe’s updates and thus may go away or not be updated to a more recent version.
Apache Felix’s SCR Annotations are used to easily define OSGi Services, Components and Properties. In OSGi R6, the OSGi consortium has released annotations for Declarative Services. These annotations duplicate the functionality of the Apache Felix SCR Annotations and thus the Apache Felix SCR annotations were deprecated.
Here are some good blog posts about this change including:
The advantages to the new OSGi DS annotations are:
@Component(immediate=true)
@Service(MyService.class)
@Service(service={MyService.class},immediate=true)
If you have other symptoms of AEM 6.3, talk to one of Perficient’s Adobe Certified Architects about upgrading your codebase to AEM 6.3.