If now a person subcribe to content, It works.
But If If Checkout and than checkin that content I've always get an error
Unable to check in Content Node due to system error:null
and the error takes place when it runs the trought the follwing code
public AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName)
throws InvalidNodeRefException, AssociationExistsException
{
// Invoke policy behaviours
invokeBeforeUpdateNode(sourceRef);
Node sourceNode = getNodeNotNull(sourceRef);
System.out.println(sourceNode);
Node targetNode = getNodeNotNull(targetRef);
System.out.println(targetNode);
System.out.println(assocTypeQName);
// see if it exists
NodeAssoc assoc = nodeDaoService.getNodeAssoc(sourceNode, targetNode, assocTypeQName);
if (assoc != null)
{
throw new AssociationExistsException(sourceRef, targetRef, assocTypeQName);
}
// we are sure that the association doesn't exist - make it
assoc = nodeDaoService.newNodeAssoc(sourceNode, targetNode, assocTypeQName);
AssociationRef assocRef = assoc.getNodeAssocRef();
// Invoke policy behaviours
invokeOnUpdateNode(sourceRef);
invokeOnCreateAssociation(assocRef);
return assocRef;
}