2 Replies Latest reply on Mar 26, 2015 1:20 AM by danil

    Activity stream entry gives an error because of uninstallation of an app which removed the stream entry

    shipra

      Hi,

       

      I have created an app using JAVA SDK in which I am creating an activity stream entry.

      Whenever I have to re-build an app I have to un-install it from jive instance and build it otherwise it gives a build failure.

       

      Also on un-installation of an app whatever stream entry it created  gets removed.  Is there any way to avoid this?

       

      The scenario which created an error in the activity stream entry and is not letting any new activity be added in the stream:

       

      A user had  liked one of the activity stream entry which created a latest like entry in the activity stream. On uninstallation of the stream all the activity stream entries were removed but it created an error in the activity stream.

      Code used to create an activity stream entry:

      function postActivity(){

              var params = {activity: {

                                                   title:"Hello Jive!",

                                                   body:"Posting to the stream is easy!"

                                                 }

                                    };

       

             osapi.activities.create(params).execute(function(data) {

                  alert("activity sent!");

                });

      }

       

       

      Error message in the stream:

      Latest Likes

       

       

          TypeError: opt_data.activity.content.likedContent is undefined params:{"activity":{"activityUser":{"type":3,"link":"/people/ANONYMOUS","subject":"Guest","iconCss":"jive-icon-profile","archetype":"people","thumbnailTemplate":"jive.browse.user.thumbnailUserItem","detailTemplate":"jive.browse.user.detailUserItem","displayExternallyVisibleVisualCue":false,"prop":{"avatarID":"-1","presence":{"online":false,"jsObject":"null"},"isVisibleToPartner":false,"firstName":"ANONYMOUS"},"username":"ANONYMOUS","displayName":"Guest","anonymous":true,"enabled":true,"external":false,"partner":false,"entitled":true,"visible":true,"avatarID":"-1","id":"-1","objectType":3,"unmodified":true},"content":{"activityTemplate":"jive.eae.digest.subItem.acclaim","groupedActivityStreamTemplate":"jive.eae.activitystream.item.grouped.latestLikes","expandedActivityStreamViewTemplate":"jive.eae.activitystream.item.expanded.latestLikes","domIDPostfix":"419149893310462","visibleToExtCollaborator":false,"id":447369365,"objectType":447369365,"subject":"","plainSubject":"","jiveObjectIcon":"images/jive-icon-doctype-generic-16x16.gif","jiveObjectURL":"","plainSubjectSnippet":"","jiveObjectCSS":"jive-icon-med jive-icon-doctype-generic"},"groupedUsers":[],"groupedViewerIndex":-1,"groupedItems":[],"groupedModifiers":[],"groupedOldestTimestamp":"1424453686763","domIDPostfix":"419149893509091","liked":false,"likeCount":0,"likable":false,"parentActivity":true,"containsMention":false,"type":"created","read":false,"creationTime":"Less than a minute ago","creationDate":"1424453686763","current":false,"targetObjectID":447369365,"targetObjectType":447369365,"containerObjectID":17,"containerObjectType":-2,"hasMoreText":false,"moderated":false,"visibleToExtCollaborator":false},"user":{"type":3,"link":"/people/admin","subject":"Administrator","iconCss":"jive-icon-profile","archetype":"people","thumbnailTemplate":"jive.browse.user.thumbnailUserItem","detailTemplate":"jive.browse.user.detailUserItem","displayExternallyVisibleVisualCue":false,"prop":{"avatarID":"1039","presence":{"online":false,"jsObject":"null"},"isVisibleToPartner":false},"username":"admin","displayName":"Administrator","anonymous":false,"enabled":true,"external":false,"partner":false,"email":"admin@example.com","entitled":true,"visible":true,"avatarID":"1039","id":"1","objectType":3,"creationTime":"6 months ago","creationDate":"1407494612110","unmodified":false,"modificationTime":"Less than a minute ago","modificationDate":"1424453678882"},"fromTemplate":"latest_likes"}

       

       

      Error message in the logs:

       

      Caused by: com.google.template.soy.sharedpasses.render.RenderException: In template jive.eae.digest.subItem.acclaim: When evaluating "length(match($activity.content.likedContent.jiveObjectURL, '#', 'g')) == 0": Error while computing function "match($activity.content.likedContent.jiveObjectURL, '#', 'g')": Expecting string value but instead encountered type UndefinedData

       

      Also on debug it was found that the activity entry which is undefined in the above logs is:

       

      ActivityImpl{bean=ActivityBean{activityID=0, targetObjectID=1034, targetObjectType=1501, userID=1, containerObjectID=1238, containerObjectType=1400, type=created, read=true, current=false, creationDate=Tue Feb 17 06:05:40 EST 2015}}

       

      (This was the like activity on the activity stream created by the app.The activity got removed but like object is still causing the issue)

       

      Also when I create a new activity stream entry it gives the following error. An event is created but it cant be added in the activity stream.

       

      2015-02-20 12:38:41,894 [TaskEngineWorker-pool-1] [::] ERROR com.jivesoftware.community.eae.impl.ActivityManagerImpl - Unable to add new activity. Writing to journal temporarily.

      com.jivesoftware.service.ingress.ActivityStreamServiceException: Could not get tenancy information to make service request!

        at com.jivesoftware.service.client.search.JiveActivityStreamIngressService.add(JiveActivityStreamIngressService.java:41)

        at com.jivesoftware.community.eae.impl.ActivityManagerImpl.addActivity(ActivityManagerImpl.java:279)

        at com.jivesoftware.community.eae.impl.ActivityManagerImpl.addActivity(ActivityManagerImpl.java:366)

        at com.jivesoftware.community.eae.proxy.ActivityManagerProxy.addActivity(ActivityManagerProxy.java:59)

       

      Ryan Rutan

      Please let me know what could have caused this issue.

       

       

      Rajmani Oinam Lea Reznik