NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.user.util.UserManager'

Hi there,

I get the following error while I run my plugin. Not sure what is causing the issue. Looking for some help.

I tried atlas-clean also.

error log

******************************************************************
[INFO] [talledLocalContainer] ___ FAILED PLUGIN REPORT _____________________
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] 1 plugin failed to load during JIRA startup.
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] 'com.cgi.asop.asopWorkflowFieldsDelegator' - 'ASOP WorkFlow Fields Delegator' failed to load.
[INFO] [talledLocalContainer] Error creating bean with name 'projectAdminServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory. **NoSuchBeanDefinitionException** : No qualifying bean of type ' **com.atlassian.jira.user.util.UserManager** ' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
[INFO] [talledLocalContainer] No qualifying bean of type 'com.atlassian.jira.user.util.UserManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] It was loaded from C:\D-Drive\Workspace_ProAction\asopWorkflowFieldsDelegator\target\jira\home\plugins\installed-plugins\asopWorkflowFieldsDelegator-1.0.0-SNAPSHOT.jar
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] *******************************************************

My Servlet

@Component
public class ProjectAdminServlet extends HttpServlet {

	@JiraImport
	private final com.atlassian.jira.user.util.UserManager jiraUserManager;
	@ComponentImport
	private final TemplateRenderer engine;
	@JiraImport
	private final com.atlassian.sal.api.user.UserManager userManager;
	
	@Inject
	public ProjectAdminServlet(com.atlassian.jira.user.util.UserManager jiraUserManager, 
			TemplateRenderer engine,
			com.atlassian.sal.api.user.UserManager userManager) {
		this.jiraUserManager = jiraUserManager;
		this.engine = engine;
		this.userManager = userManager;
	}
	
	@Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
		//.. my logics
	}
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.org.asop</groupId>
	<artifactId>asopWorkflowFieldsDelegator</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<organization>
		<name>Org</name>
		<url>www.org.com/</url>
	</organization>
	<name>asopWorkflowFieldsDelegator</name>
	<description>This is the com.org.asop:asopWorkflowFieldsDelegator plugin for Atlassian JIRA.</description>
	<packaging>atlassian-plugin</packaging>
	<dependencies>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-api</artifactId>
			<version>${jira.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-core</artifactId>
			<version>${jira.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugin</groupId>
			<artifactId>atlassian-spring-scanner-annotation</artifactId>
			<version>${atlassian.spring.scanner.version}</version>
			<!-- <scope>compile</scope> -->
			<scope>provided</scope>
		</dependency>
		<!-- <dependency>
			<groupId>com.atlassian.plugin</groupId>
			<artifactId>atlassian-spring-scanner-runtime</artifactId>
			<version>${atlassian.spring.scanner.version}</version>
			<scope>runtime</scope>
		</dependency> -->
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>jsr311-api</artifactId>
			<version>1.1.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.2.2-atlassian-1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.6.6</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.sal</groupId>
			<artifactId>sal-api</artifactId>
			<version>3.0.7</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity</artifactId>
			<version>1.7</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.crowd</groupId>
			<artifactId>embedded-crowd-api</artifactId>
			<version>2.8.0-OD-6-JIRA-05</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugins</groupId>
			<artifactId>atlassian-plugins-webfragment-api</artifactId>
			<version>4.1.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugins</groupId>
			<artifactId>atlassian-plugins-core</artifactId>
			<version>2.6.0</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-projects-api</artifactId>
			<version>4.1.13</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>velocity-tools</groupId>
			<artifactId>velocity-tools-generic</artifactId>
			<version>1.4</version>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-client</artifactId>
			<version>1.8</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20090211</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>r05</version>
		</dependency>
		<dependency>
			<groupId>org.apache.lucene</groupId>
			<artifactId>lucene-core</artifactId>
			<version>8.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.cargo</groupId>
			<artifactId>cargo-maven2-plugin</artifactId>
			<version>1.4.7</version>
		</dependency>
		<dependency>
			<groupId>net.java.dev.activeobjects</groupId>
			<artifactId>activeobjects</artifactId>
			<version>3.0.0</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.activeobjects</groupId>
			<artifactId>activeobjects-plugin</artifactId>
			<version>3.0.3</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.collections</groupId>
			<artifactId>google-collections</artifactId>
			<version>1.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.upm</groupId>
			<artifactId>licensing-api</artifactId>
			<version>2.19.0.4-D20150528T215101</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.templaterenderer</groupId>
			<artifactId>atlassian-template-renderer-api</artifactId>
			<version>4.0.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.upm</groupId>
			<artifactId>upm-api</artifactId>
			<version>2.19.0.4-D20150528T215101</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.ofbiz</groupId>
			<artifactId>ofbcore-jira-entity</artifactId>
			<version>2.1.8</version>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.8.5</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>com.atlassian.maven.plugins</groupId>
				<artifactId>jira-maven-plugin</artifactId>
				<version>${amps.version}</version>
				<extensions>true</extensions>
				<configuration>
					<productVersion>${jira.version}</productVersion>
					<productDataVersion>${jira.version}</productDataVersion>
					<enableQuickReload>true</enableQuickReload>
					<!-- <enableFastdev>false</enableFastdev> -->
					<instructions>
						<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
						<Export-Package>com.atlassian.plugins.tutorial.api,</Export-Package>
						<!-- 
						<Import-Package>org.springframework.osgi.*;resolution:="optional",
							org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
 -->
 						<Import-Package>*</Import-Package>
						<Spring-Context>*</Spring-Context>
					</instructions>
					<startupTimeout>1500000</startupTimeout>
					<shutdownTimeout>900000</shutdownTimeout>
					<productDataPath>${basedir}/src/test/resources/generated-test-resources.zip</productDataPath>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.atlassian.plugin</groupId>
				<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
				<version>${atlassian.spring.scanner.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>atlassian-spring-scanner</goal>
						</goals>
						<phase>process-classes</phase>
					</execution>
				</executions>
				<configuration>
					<scannedDependencies>
						<dependency>
							<groupId>com.atlassian.plugin</groupId>
							<artifactId>atlassian-spring-scanner-external-jar</artifactId>
						</dependency>
					</scannedDependencies>
					<verbose>false</verbose>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.atlassian.maven.plugins</groupId>
				<artifactId>amps-maven-plugin</artifactId>
				<version>8.0.2</version>
				<configuration>
					<startupTimeout>1200000</startupTimeout>
					<shutdownTimeout>900000</shutdownTimeout>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<fork>true</fork>
					<executable>C:\Program Files\Java\jdk1.8.0_91\bin\javac.exe</executable>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.atlassian.plugin</groupId>
										<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
										<versionRange>[1.2.13,)</versionRange>
										<goals>
											<goal>atlassian-spring-scanner</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.atlassian.maven.plugins</groupId>
										<artifactId>jira-maven-plugin</artifactId>
										<versionRange>[8.0.1,)</versionRange>
										<goals>
											<goal>compress-resources</goal>
											<goal>filter-plugin-descriptor</goal>
											<goal>filter-test-plugin-descriptor</goal>
											<goal>generate-rest-docs</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<pluginRepositories>
		<pluginRepository>
			<id>atlassian-public</id>
			<url>https://m2proxy.atlassian.com/repository/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
	<properties>
		<jira.version>8.2.3</jira.version>
		<amps.version>8.0.1</amps.version>
		<atlassian.spring.scanner.version>2.1.3</atlassian.spring.scanner.version>
		<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
		<quick.reload.version>3.0.0</quick.reload.version>
		<testkit.version>6.3.11</testkit.version>
		<maven.test.skip>true</maven.test.skip>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>
</project>

META-INF/spring/plugin-context.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.atlassian.com/schema/atlassian-scanner/2
http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd">

<!-- This file is loaded at plugin boot time, and loads all the components that don't have @Profile set.

See also dynamic-spring-scanner.xml for loading of those that have @Profile("dynamic"). -->

<atlassian-scanner:scan-indexes />

</beans>

Thanks!
Kumar

You can’t import two beans of the same name right? Use something like this, I think.

@ComponentImport("salUserManager")
private final com.atlassian.sal.api.user.UserManager salUserManager
@ComponentImport("jiraUserManager")
private final com.atlassian.jira.user.util.UserManager jiraUserManager;

The beans are already with different names jiraUserManager and userManager .
I tried to run my plugin only with com.atlassian.jira.user.util.UserManager jiraUserManager and removing com.atlassian.sal.api.user.UserManager userManager in my class. But still getting the same error.

You should avoid to use jira-core components with sal components in your class.

Try to annotate your components like code snippet below.

package pl.bohdanbelokur.alarm.servlet;

import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.jira.user.util.UserUtil;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.sal.api.auth.LoginUriProvider;
import com.atlassian.sal.api.websudo.WebSudoManager;
import com.atlassian.sal.api.websudo.WebSudoSessionException;
import com.atlassian.templaterenderer.TemplateRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;

@Component
public class AdminAlarmsServlet extends HttpServlet{
    private static final Logger log = LoggerFactory.getLogger(AdminAlarmsServlet.class);

    @ComponentImport
    @Autowired
    private JiraAuthenticationContext authenticationContext;

    @ComponentImport
    @Autowired
    private LoginUriProvider loginUriProvider;

    @ComponentImport
    @Autowired
    private UserUtil userUtil;

    @ComponentImport
    @Autowired
    private WebSudoManager webSudoManager;

    @ComponentImport
    @Autowired
    private TemplateRenderer templateRenderer;

    private static final String ADMIN_ALARMS_TEMPLATE = "/templates/servlet/admin-alarms.vm";
    /**
     * Getting URI for redirect if user not logged in
     * @param request HttpServletRequest
     * @return URI for redirect
     */
    private URI getUri(HttpServletRequest request) {
        StringBuffer builder = request.getRequestURL();
        if (request.getQueryString() != null)
        {
            builder.append("?");
            builder.append(request.getQueryString());
        }
        return URI.create(builder.toString());
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        /**
         * This part of code should realize in ServletFilter
         */
        if(!authenticationContext.isLoggedInUser()) {
            resp.sendRedirect(loginUriProvider.getLoginUri(getUri(req)).toASCIIString());
            return;
        }

        if(!userUtil.getJiraSystemAdministrators().contains(authenticationContext.getLoggedInUser())
                && !userUtil.getJiraAdministrators().contains(authenticationContext.getLoggedInUser())) {
            resp.setStatus(403);
            return;
        };
        /**
         * Rendering template
         */
        try {
            templateRenderer.render(ADMIN_ALARMS_TEMPLATE, resp.getWriter());
        }  catch (WebSudoSessionException ex) {
            webSudoManager.willExecuteWebSudoRequest(req);
        }
    }

}

It’s curious because my method works fine for me, specifically with the UserManager classes.

I am not sure still why com.atlassian.jira.user.util.UserManager is not working. Now I am using JiraAuthenticationContext as an alternative.

1 Like

I think the best way to troubleshoot runtime dependency issues is to tail the application log during the plugin installation or quick reload installation. I have found some issues deep within the stack, so if you want to continue troubleshooting, I’d look into a more complete output of the problem.

1 Like

Here’s the complete trace I found in my atlassian-jira log. This problem I get only when I use com.atlassian.jira.user.util.UserManager

2020-03-15 22:09:56,191 http-nio-2990-exec-4 ERROR admin 1329x1913x1 1xgrs2e 0:0:0:0:0:0:0:1 /plugins/servlet/com.cgi.asop.jira.plugins.workflowfieldsdelegator/projectadmin [c.a.plugin.servlet.DefaultServletModuleManager] Unable to create new reference LazyLoadedServletReference{descriptor=com.cgi.asop.asopWorkflowFieldsDelegator:Cgi.WorkflowFieldsDelegator.Admin.ProjectAdminServlet (null), servletContext=org.apache.catalina.core.ApplicationContextFacade@36e20b3a}
io.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.cgi.asop.workflowfieldsdelegator.servlets.ProjectAdminServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.user.util.UserManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
	at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:430)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:409)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(DefaultServletModuleManager.java:229)
	at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:37)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	... 53 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 24 filtered
	at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
	... 41 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
	... 1 filtered
	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
	... 36 filtered
	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
	... 10 filtered
	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
	... 4 filtered
	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
	... 26 filtered
	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
	... 24 filtered
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.cgi.asop.workflowfieldsdelegator.servlets.ProjectAdminServlet': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.user.util.UserManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:733)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:198)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1266)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1123)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.atlassian.plugin.osgi.spring.DefaultSpringContainerAccessor.createBean(DefaultSpringContainerAccessor.java:99)
	at com.atlassian.plugin.module.ClassPrefixModuleFactory.createModule(ClassPrefixModuleFactory.java:35)
	at com.atlassian.plugin.module.PrefixDelegatingModuleFactory.createModule(PrefixDelegatingModuleFactory.java:88)
	at com.atlassian.plugin.servlet.descriptors.ServletModuleDescriptor.getModule(ServletModuleDescriptor.java:42)
	at com.atlassian.plugin.servlet.DelegatingPluginServlet.<init>(DelegatingPluginServlet.java:30)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:528)
	at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedServletReference.create(DefaultServletModuleManager.java:512)
	at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
	at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
	... 237 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.user.util.UserManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:819)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:725)

I found a question I raised myself concerning this same issue a while back. Why do I receive a 'No Qualifying Bean Found" error when installing a plugin that uses both SAL and JIRA UserManager classes?

The only real difference again I am seeing is annotations.

  • Replace instances of @Component with @Named
  • Stop using @JiraImport and instead use @ComponentImport(value = "nameOfBean")

I am of the belief that this will solve the issue if I understand your current state correctly.

I used these native annotations before using jira annotations. I have the same issue.

I had a same problem.
First, U check two files “pom.xml”," META-INF/spring/plugin-context.xml" follow site.
https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/\

Second,
Don’t try to Use.
@JiraImport
private final com.atlassian.sal.api.user.UserManager userManager;
Use ComponentAccessor.getUserManager();