No qualifying bean of type 'com.atlassian.jira.security.groups.GroupManager' available

Michał Szulda November 22, 2024

Hi Community,

I am trying to use com.atlassian.jira.security.groups.GroupManager interface in my java version 2 plugin for jira data center using atlassian scanner. Unfortunately the result is 

...No qualifying bean of type 'com.atlassian.jira.security.groups.GroupManager' available...

 

I was trying that with Jira DC 9.12.15 and JIRA DC 10.0.0. same result. Once I delete 

 

@ComponentImport GroupManager groupManager from the class constructor plugin works fine. I can also use ComponentAssesor to get an access the the GroupManager interface but as long as I understand it is only workaround.
What also confusing me is that I can use another interfaces like: UserService or LoginService without that problem.
Any help ?

1 answer

0 votes
Ignat Alexeyenko
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2025

Hi @Michał Szulda ,

 

The bean error for GroupManager typically occurs when there are multiple beans of the same type or improperly configured OSGi metadata. Here’s how you can resolve it:

 

Solution 1: Using @Bean and Filtering 

Explicitly import the correct GroupManager bean with a filter:

 

@Bean
public GroupManager groupManager() {

    return OsgiServices.importOsgiService(GroupManager.class, "(component.name=groupManager)");

}

 

This ensures the exact implementation is resolved based on the component.name property.

 

Solution 2: Direct Injection with Qualifier

In case You don't use @Bean, this syntax may be more familiar:

 

@Autowired
@Qualifier("groupManager")
private GroupManager groupManager;

 

This assumes you have two beans (e.g., groupManager and groupService) and want to explicitly pick one.

 

My Experience: Manifest Issues

 In my case, the issue was caused by unpacking and repacking JAR files, which corrupted the manifest file. Fixing the META-INF/MANIFEST.MF was the path to address the issue.

 

I hope this helps! Let me know if you need more details.

 

Yours,
Ignat.

Suggest an answer

Log in or Sign up to answer