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?
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.