Hi,
I followed the instructions to add Jira addon with Issue listener in
Writing Jira event listeners with the atlassian-event library
Add also downloaded the example.
It works fine when running it on test environment using atlas-run -V 8.20.10 which is our production version.
But when I install the JAR, even on local clean Jira installed on my computer, it doesn’t work.
I added prints to the log and even the registration doesn’t run (in test env, using atlas-run, it does).
//@Inject <<— I tried with this markup too
@Autowired
public myListener(EventPublisher eventPublisher) { \I tried to use @JiraImport - but failed to import the relevant lib
log.info(“^^^^^^^^^^^^^^^^ myListener INJECT”);
this.eventPublisher= eventPublisher;
}
@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);
}
@Override
public void afterPropertiesSet() throws Exception {
log.info(“^^^^^^^^^^^^^^^^ myListener afterPropertiesSet”);
java.lang.System.out.println("************************ MY onIssueEvent afterPropertiesSet ");
eventPublisher.register(this);
}
Any idea )-:
I tried to add sal to the pom to the case the spring version is not the same as the UPM’s one as suggested in How to find out org.springframework version used by UPM - Jira Development / Jira Server - The Atlassian Developer Community
com.atlassian.sal sal-api 3.0.0 providedWhen I install the JAR I get:
2022-09-27 09:54:39,699+0300 UpmAsynchronousTaskManager:thread-2 ERROR odedmo 594x297x1 1g6t0hr 0:0:0:0:0:0:0:1 /rest/plugins/1.0/ [c.a.j.cache.request.RequestCacheRecorderImpl] Invalid use of RequestCache by thread: UpmAsynchronousTaskManager:thread.Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. This message will be logged once per thread. This ERROR should be fixed on the caller side (check the stack-trace or thread-name) as it is causing inconsistent data.
java.lang.Throwable
at com.atlassian.jira.cache.request.RequestCacheRecorderImpl.errorLogOOCThreadUsage(RequestCacheRecorderImpl.java:32)
at com.atlassian.jira.cache.request.RequestCacheRecorderImpl.recordRequestCacheOOCUsage(RequestCacheRecorder………