Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Listener don't work after restart jira

Manuel Chanivet Roca January 21, 2019

I have a custom listener that works fine, but when I restart Jira, this listener does not work until I reinstall my custom addon.

 

This is the Listener:

public class CodProyectoListener implements InitializingBean, DisposableBean {
private static final Logger log = LoggerFactory.getLogger(CodProyectoListener.class);

private EventPublisher eventPublisher;
private ApplicationProperties applicationProperties;
private CodProyectoUtils codProyectoUtils;

public CodProyectoListener(ApplicationProperties applicationProperties, EventPublisher eventPublisher, CodProyectoUtils codProyectoUtils) {
this.applicationProperties = applicationProperties;
this.eventPublisher = eventPublisher;
this.codProyectoUtils = codProyectoUtils;
}

@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);

}

@Override
public void afterPropertiesSet() throws Exception {
eventPublisher.register(this);
}
.
.
.
}

 

And this is the atlassian-plugin.xml:

<component-import key="eventPublisher" interface="com.atlassian.event.api.EventPublisher"/>
<component key="eventListener" class="es.mutua.jira.addons.listener.CodProyectoListener">
<description>Recupera informacion sobre el CF Código Proyecto.</description>
</component>

 

Can someone help me?

1 answer

0 votes
Jobin Kuruvilla [Adaptavist]
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.
January 21, 2019

It is possible that the EventPublisher is not injected properly due to Atlassian Spring Scanner version. You might want to use the latest method of using annotations.

Check https://developer.atlassian.com/server/jira/platform/writing-jira-event-listeners-with-the-atlassian-event-library/ for sample code.

Also see https://bitbucket.org/atlassian/atlassian-spring-scanner/overview

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events