Missed Team ’24? Catch up on announcements here.

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

EventListener is not called in Bitbucket 4.4.1 or 4.0.1

rinoux October 27, 2016

I've create some EventListeners for listening to pull request events, such as open, reopened, declined, merge.  They were work successfully in the Bitbucket 4.9.1, but when I changed to Bitbucket 4.4.1 or 4.0.1, these EventListeners aren't even triggered. BTW, I wrote plugin by scala. Here is my example class:

import com.atlassian.bitbucket.event.pull.PullRequestDeclinedEvent
import com.atlassian.event.api.EventListener
import com.fr.cra.Logging
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component


@Component
class PullRequestDeclinedListener @Autowired()(cachedRepoInformation : CachedRepoInformation) extends AnyRef with Logging {
  @EventListener
  def onPullRequestDeclined(event : PullRequestDeclinedEvent) : Unit = {
    println("pullrequest declined")
    val pr = event.getPullRequest
    //DO SOMETHING
  }

AND, I use spring Atlassian spring scanner while I need not register the listener to Atlassian-plugin.xml.

2 answers

0 votes
rinoux October 27, 2016

I changed project jdk to 1.7, doesn't work still. 

0 votes
G__Sylvie_Davies__bit-booster_com_
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 27, 2016

Hmm, I wonder if it's related to this:  https://answers.atlassian.com/questions/43550567.   Seems some Java 8 features don't work with the Spring scanner.   If you rewrite your listener class from Scala to pure Java 7 I suspect it might start working.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events