EventListener is not called in Bitbucket 4.4.1 or 4.0.1

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

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

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

2 answers

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.

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

96 views 4 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you