Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to unregister an eventListener manually?

Matías Acosta February 27, 2015

I installed a plugin which registered an eventListener but after uninstalling it the listener was still working and executing code. I tried reinstalling the plugin adding unregisterAll() before the registering (according to another answer on this site) but just made things worse, the plugin wont finish the install. 

So, is there a way to unregister the eventListener manually? Will restarting Confluence do the trick?

 

 

Thanks!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2015

If you've uninstalled the plugin without un-registering the event handler, you need to restart Confluence to clear the old event handler out.  Calling unregisterAll from within a newly-installed version of the plugin won't work because Confluence treats it as a different plugin (it has no event handles to unregister).

The correct behaviour is to call unregister when the plugin is un-installed or disabled.  You can do this by making your event listener component implement the DisposableBean interface and calling the unregister method within the destroy method.  Here's an example: https://developer.atlassian.com/confdev/confluence-plugin-guide/confluence-plugin-module-types/event-listener-module/annotation-based-event-listener-example

 

Matías Acosta March 3, 2015

Thank you for your answer, it worked.

Vikash Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2016

Hi Joe,

Restarting confluence did not unregister the listener and the above approach did not fix the problem in my case. Also plugin developer cannot ask customers to restart Confluence before updating the new version of plugin.

Apart from restarting confluence what other solutions are there. If the event listener was not deregistered in the old version of plugin how can I deregister event listener in the new version of plugin. 

I see the old code is still executing even after complete uninstall of the plugin. 

 

Thank you,

abhisek kumar srivastava March 16, 2018

I am also facing the same issue, did any one have solution ?

TAGS
AUG Leaders

Atlassian Community Events