Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not instantiate event handler. Type: Sitecore.Publishing.HtmlCacheClearer

It was all of a sudden and it just stopped working. I have no clue what went wrong, what caused this to occur:

Could not instantiate event handler. Type: Sitecore.Publishing.HtmlCacheClearer. Method: ClearCaches (method: Sitecore.Events.Event+EventSubscribers.Add(String eventName, XmlNode configNode)).

I tried everything that would make it work but it didn't

  1. Re-copied my Sitecore files from Sitecore 7.2
  2. Re-Indexed my Solr
  3. Created a completely new Sitecore project
  4. Republished the complete site
  5. Banged my head on the desk

Can anyone tell me the reason for this and what could be the solution. I am fairly new to Sitecore.

Updating the publish:end and publish:end:remote

 <event name="publish:end">
    <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCaches">
      <sites hint="list">
        <site>website</site>
      </sites>
    </handler>
  </event>
  <event name="publish:end:remote">
    <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCaches">
      <sites hint="list">
        <site>website</site>
      </sites>
    </handler>
  </event>
like image 877
Todd Wilson Avatar asked Jan 16 '16 14:01

Todd Wilson


2 Answers

I may be wrong but could it be a simple spelling mistake in the handler registration in the events pipeline? I looked at the source code for SC 7.2 update 4 and there is no method called Sitecore.Publishing.HtmlCacheClearer.ClearCaches, how ever there IS a method called ClearCache.

Try to change the method name to ClearCache.

Cheers, Bo

like image 173
Bo Breiting Avatar answered Nov 12 '22 10:11

Bo Breiting


This is a long shot, but I encountered a problem with the HtmlCacheClearer a few months back. Turns out it has a dependency on a legacy Lucene index called __System.

If that index get corrupted, it can cause some unexpected results. My situation wasn't exactly the same as yours but the fix simple and non-invasive. So it might be worth trying.

Just delete the __System index from you datafolder (it doesn't contain anything that needs to be kept).

I wrote a blog post about this issue.

like image 1
Martin Davies Avatar answered Nov 12 '22 09:11

Martin Davies