aemsling

AEM Resources missing sling:resourceType


My content repository over a 2 year span has accumulated many obsolete component resources. The component nodes are missing sling:resourceType property. These component nodes looks like this:

missing sling:resourceType

Due to such bad resources, the page is throwing below exception:

14.09.2017 12:33:21.079 *ERROR* [172.21.142.98 [1505392399461] GET /content/xx/en_ca/home.html HTTP/1.1] 
org.apache.sling.servlets.get.impl.DefaultGetServlet No renderer for extension html, cannot render resource Paragraph, 
path=/content/xx/en_ca/home/jcr:content/par-sidebar/contentbox_c540/rightRailContentPar/contentbox_f1fd, 
type=nt:unstructured, cssClass=default, column=0/0, diffInfo=[null], 
resource=[JcrNodeResource, type=nt:unstructured, superType=null, 
path=/content/xx/en_ca/home/jcr:content/par-sidebar/contentbox_c540/rightRailContentPar/contentbox_f1fd]

Further digging I found someone had written a tool to cleanup such obsolete resources.

While it is easy to query and cleanup such invalid nodes, my question how did such resources end up in repository? I tried to simulate by moving components, deleting components from page but in vain. There is no custom scripting that is removing sling:resourceType. Is this issue faced only by me? Or is there any product issue/usecase that can clear the type of resource?

I am running AEM 6.0 SP2.


Solution

  • Seems this is a known product bug to be fixed for future AEM. This is the response I got from daycare ticket:

    There are several known issues related to sling:resourceType in AEM 6.0 SP2 and later but the one that I could find nearest to the scenario you have mentioned occurs when the components are copied and pasted.

    It removes/breaks the sling:resourceType property. This issue is covered under the internal id -CQ-4212306, the fix for which will be a part of the future version of AEM.