Removal of EventListener

Working on implementing an event listener. To familiarize myself with how to do this I followed along https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingEventListenerTutorial/ . I initially added the proper XObjects to a page and when saving I got an error stating Conflict. I deleted the objects and then tried the tutorial on a different page where it succeeded. What was interesting is that it acted as if the event was being captured twice. Content with knowing that it worked I deleted those objects and then deleted that page so that I could implement the event that I wanted.

The problem is that the event is still being captured and the ‘Some extra content …’ is still being added with each save to every page. After looking at the pages that I know I changed for the existence of the listener objects, and not finding any, I did an HQL query looking for any of the object classes that I added (Xwiki,ComponentClass and Xwiki.ComponentMethodClass). It did not return any found pages.

How do I remove this listener? We are running Xwiki 9.11.4.

Thanks,
Steve

It seems the event listener itself is still cached despite of the page defining it already gone.
If restarting the wiki is not an option, then I can think of two approaches:

  • Install the “Admin Tools” and use the “Flush Cache” to flush the wiki caches. Unfortunately this tool has not been updated, so the “Flush Cache” page is still in xwiki/1.0 syntax (at least in the released versions, it is fixed in the latest version from git). You will have to convert the page to xwiki/2.1 syntax manually (which should not be very hard) or build and import the latest version from git
  • Alternatively define a new event listener with exactly the same name, which does nothing. This should unregister the previous event listener, and while you will have the new listener around that one should do no harm when saving a page.

Restarting the Xwiki service worked. Thanks for your help, that was driving me mad.

–Steve