AEM 6.2 SP1 Communities - Communities Activity List component shows No activity.
- March 9, 2017
- 4 replies
- 2171 views
Description of setup and problem
AEM Version: AEM 6.2 SP1
UGC storage – JSRP.
Topology: single Author, single Publish.
“cq-social-reporting-management” bundle version: 1.0.77
Description of component and content
Component path:
/libs/social/reporting/analytics/components/hbs/communityactivitylist
Content path:
/content/CUSTOMER-communities/CUSTOMER-communities-site/en/jcr:content/content/primary/com munityactivitylis
[jcr:primaryType = nt:unstructured, sling:resourceType = social/reporting/analytics/components/hbs/communityactivitylist]
Component class: com.adobe.cq.social.reporting.analytics.impl.AnalyticsCommunityActivityCollectionImpl
Configuration:
- Type: Content
- Display title: View Recent Community Activity and Join In
- Display count: 10
- Activity type: Views
- Time period: Last 30 days
- Context Path: /content/CUSTOMER-communities/CUSTOMER-communities-site
- Member count aggregation: false
Problem
Problem: No matter how long to wait for analytics to import there is no data shown by the communityactivitylist component:
Proof of correct integration setup
In the same time “/communities/reports/views” shows Analytics reports both on author and publish without issues:
It shows data imported into “/var/statistics/sitecatalyst” which confirms that integration with Adobe Analytics configured correctly.
Additional custom eVar / event variables are being sent to Adobe Analytics as well (monitored using Adobe Marketing Cloud Debugger):
events | event2 |
eVar2 | CUSTOMER Communities Site |
eVar3 | Forum |
eVar4 | Developers |
eVar5 | /content/CUSTOMER-communities/CUSTOMER-communities-site/en/communities/developers |
eVar6 | social/forum/components/hbs/topic |
eVar7 | My test post |
eVar8 | admin |
eVar9 | /content/usergenerated/asi/jcr/content/CUSTOMER-communities/CUSTOMER-communities-site/en/c ommunities/developers/forum/jcr:content/content/primary/forum/hfu1-my_test_postdescrip |
eVar10 | /content/CUSTOMER-communities/CUSTOMER-communities-site/en |
These eVars / events are added to appropriate report suite and mapping in /etc/cloudservices Adobe Analytics config is present.
Investigation
After decompiling “AnalyticsCommunityActivityCollectionImpl” class and enabling debug log for “org.apache.jackrabbit.oak.query.QueryImpl” class, the following query discovered:
Query: SELECT * FROM [social:asiResource] AS c WHERE ISDESCENDANTNODE(c, '/content/usergenerated/asi/jcr/content/CUSTOMER-communities/CUSTOMER-communities-site') AND (NOT (c.[views_last30Days_tl] IS null)) ORDER BY [views_last30Days_tl] DESC, path=/content/usergenerated/asi/jcr/content/CUSTOMER-communities/CUSTOMER-communities-sit e//*)
So, it tries to find “views_last30Days_tl” (for our case of configuration) within UGC in social:asiResource nodes.
Nodes cannot be found cause “views_last30Days_tl” is absent in all cases.
22 results if the condition with “views_last30Days_tl” is absent.
Other related components configuration
AEM Communities Analytics Component Configuration:
(social/reporting/analytics/components/hbs/communityactivitylist added)
Primary publisher checkbox is set to true on Publish node.
Tunnel service enabled on Author with replication agent configured and tested.
Code decompiled issues found
Once decompiled the code in “cq-social-reporting-management-1.0.77.jar”, I see several problems in there which might be the root cause of this issue (inconsistencies showing that the code requires update):
- Service users used in com.adobe.cq.social.reporting.analytics.impl.AnalyticsReportImporter (analytics-import-writer, user-admin, analytics-admin) don’t exist in AEM 6.2 SP1 OOTB under /home/users/system/… . This class seems to be responsible for creation of absent “views_last30Days_tl” under UGC.
- It is not possible to run com.adobe.cq.social.reporting.analytics.impl.AnalyticsReportImporterRequestServlet with {path}.requestAnalyticsImport.json request cause of the check:
if (("cq:PollConfigFolder".equals(nodeType)) && (validResourceTypes.contains(resourceType))) {
This check means that same node in repository should in the same time of cq:PollConfigFolder type and should have resourceType property with one of social components resource types as value. Could you please point me to example of such structure in repository if I’m wrong?
This servlet fails to run on publish cause of this check and it is always in unsatisfied state on author and thus it is not possible to run import in force mode without waiting for configured interval of time.
- If we configure the com.adobe.cq.social.reporting.analytics.services.impl.AnalyticsReportImporterServiceImpl we got the following error in logs (no matter how we configure it, either using XML file or using OSGi console):
28.02.2017 17:03:39.014 *ERROR* [SCR Component Actor] com.adobe.cq.social.cq-social-reporting-management [com.adobe.cq.social.reporting.analytics.services.impl.AnalyticsReportImporterServiceImpl (2745)] The activate method has thrown an exception (java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long)
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
The component becomes unsatisfied and this doesn’t allow to change the import interval without decompile / code change / recompile procedure of the OOTB bundle.
This issues is fixable by deleting configuration and using default values (12h import interval). Anyway “views_last30Days_tl” doesn’t appear under UGC storage and concrete component node.
Questions
- Do you have any hotfixes for issues described above?
- Which service is responsible for creation of “cq:PollConfigFolder” node? Does this service put resource type (communityactivitylist) in this node? Where in the documentation I can find description of such structures and how they should look like for the importer to work properly? I mean the case of communityactivitylist component, because other poll configurations are there and they seems to be fine, but they are generic and used for general site reports:
- Shall I create system users described in the issue #1 above? Which rights should they have? Do you have a package with them? Does their absence mean inconsistent state after SP1/AEM 6.2 GA installation?
- How to make work the servlet that forces the import (AnalyticsReportImporterRequestServlet)? Which path to request? Please describe the type of content that this servlet works with considering the strange check in the code.


