G.Hari
G.Hari

Reputation: 31

How to fix NullPointerException in sites.html in AEM?

I'm suddenly getting NullPointerException in the sites.html link on the author in Adobe Experience Manager, Version 6.0.0.SP3

Any ideas? Please help.

Internal Server Error

Cannot serve request to /sites.html/content in /libs/cq/gui/components/siteadmin/admin/pagecard/pagecard.jsp

Exception:

java.lang.NullPointerException
    at org.apache.jsp.libs.cq.gui.components.siteadmin.admin.pagecard.pagecard_jsp.getCommentCount(pagecard_jsp.java:99)
...

Upvotes: 0

Views: 5017

Answers (3)

Ankur Agarwal
Ankur Agarwal

Reputation: 1

I think we need to add the property under /content/your-folder/jcr:content as**: jcr:title : give the exact name . Click on add and save all.

Upvotes: 0

G.Hari
G.Hari

Reputation: 31

We found missing jcr:content nodes for some pages under /content. Some existing jcr:content nodes were missing jcr:title property. We added the missing jcr:content nodes and jcr:title property. This solved the issue.

Note: The root of any of the sites (specifically sub-sites) should contain the following within their jcr:content – 1. Title 2. cq:allowedTemplates - to define the templates that go with this site specifically. 3. designPath – which defines the clientlibs for the site and can contain options for the sidekick.

Upvotes: 2

Go to crx-quickstart folder in your file system and search for pagecard_jsp.java.

What is on line 99? I have a different version but I guess it is this line:

Resource commentsResource = page.getContentResource().getChild("alt/comments");

If this line throws a NPE, it means that one of the top-level pages under /content is missing jcr:content node or the node is corrupted.

It is just a wild guessing without details.

Upvotes: 1

Related Questions