Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
  • Community
  • Answers Developer Questions
  • Questions
  • What does implement RefRestrictionService in Bitbucket 4.11? Wiring ERROR: No qualifying bean of type [com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionService] found

What does implement RefRestrictionService in Bitbucket 4.11? Wiring ERROR: No qualifying bean of type [com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionService] found

tarobaro November 24, 2016

I am porting add-on from stash into bitbucket. The Bitbucket add-on uses RefRestrictionService to calls: setRestrictions() and hasPermission(). The Stash version of add-on used wired BranchPermissionService and restrictBranch() and so on.

Here the log snippet from atlas-run/debug when starting Bitbucket add-on:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301) ~[DefaultListableBeanFactory.class:4.3.2.RELEASE]
[INFO] [talledLocalContainer] ... 9 common frames omitted

The BranchPermissionService has implementation in BranchPermissionServiceImpl.

I have not found any implementation of RefRestrictionService.

Which artifact does provide the RefRestrictionService implementation of RefRestrictionService in bitbucket, please?  

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Johannes Heger November 25, 2016

Add the following line to your atlassian-plugin.xml

<component-import key="refRestrictionService" interface="com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionService"/>

Please find more details in the code of my plugin My Branches. It is available for Stash as well as Bitbucket, so you can compare both branches:

https://bitbucket.org/jheger/stash-mybranches

https://bitbucket.org/jheger/stash-mybranches/src/baa328ad8e25164fc65c539fc3b1bf1c63f4932f/stash-mybranches/src/main/java/jh/atlassian/stash/mybranches/MyBranchesCollector.java?at=master&fileviewer=file-view-default

Kind regards, Johannes

tarobaro November 25, 2016

Thank you, Johannes, works perfect!

Kind Regards, Taras

TAGS
AUG Leaders

Atlassian Community Events