2

I have created a SharePoint 2010 (SP1) timer job which utilises the SharePoint Managed Metadata Service.

The code I have is :

// Get the taxonomy session
TaxonomySession session = new TaxonomySession(this.SharePointSite);
if (session == null)
{
   LoggingService.LogVerbose("Taxonomy store unavailable");
   return null;
}
// Get the default keyword TermStore for the provided site
TermStore defaultKeywordStore = session.DefaultKeywordsTermStore;
if (defaultKeywordStore == null)
{
    LoggingService.LogVerbose("Default Keyword store unavailable for Taxonomy Session");
    return null;
}

From time to time, defaultKeywordStore is returned as null - occasionally, for periods, every defaultKeywordStore is returned as null for every call.

Anyone seen this sort of behaviour before?

1
  • I am also getting the same issue. Any one has any solution for this?
    – Ven
    Commented May 25, 2016 at 11:21

1 Answer 1

0

To fix the issue, please make sure all the below settings are properly intact, if not then you get the above error time to time.

  1. First of all check that your web application has connection with managed metadata service in Central administration > Manage web applications > Service connection and make sure only one MMS associated with the web app, DefaultKeywordsTermStore returned null when there were several managed metadata connections defined for single web application
  2. Manage service applications > select Managed metadata service connection and click Properties button on the ribbon. On the opened dialog ensure that option “This service application is the default storage location for Keywords” and “This service application is the default storage location for column specific term sets".
  3. Go to Manage service applications > select Managed metadata service application and click Permissions button on the ribbon.Ensure that account under which you run the code has at least “Read access to term store” right.

Check here for more details. http://venkychilukuri.wordpress.com/2013/09/13/taxonomysession-defaultkeywordstermstore-and-defaultsitecollectiontermstore-can-be-null/

1
  • I have checked the above steps, but it still becomes null intermittently. Has anyone got any solution for this yet?
    – Ven
    Commented May 25, 2016 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.