Springscanner Unsatisfied dependendency error

AV June 21, 2019

Hi.

I try to build plugin with custom web-panel and context-provider using PluginSettingsFactory
SettingsStoreService.class

@Component
public class SettingsStorageService {
@Autowired
final PluginSettingsFactory pluginSettingsFactory;
private String storageKey;

public SettingsStorageService(PluginSettingsFactory pluginSettingsFactory)
{...

MainMenu.class

public class MainMenu extends AbstractJiraContextProvider {

private SettingsStorageService settingsStorageService;

public MainMenu(@ComponentImport PluginSettingsFactory pluginSettingsFactory)
{
settingsStorageService = new SettingsStorageService(pluginSettingsFactory);
}

@Override
public Map getContextMap(ApplicationUser applicationUser, JiraHelper jiraHelper)
{...

But springscanner says  

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'com.avvd.jira.plugin.additional.MainMenu': Unsatisfied dependency expressed through constructor argument with index 0 of type
[com.atlassian.sal.api.pluginsettings.PluginSettingsFactory]: No qualifying bean of type [com.atlassian.sal.api.pluginsettings.PluginSettingsFactory]
found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:
{@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.atlassian.sal.api.pluginsettings.PluginSettingsFactory]
found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:
{@com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value=)}

 How to make proper ComponentImport in this case?
Thanks for help.

0 answers

Suggest an answer

Log in or Sign up to answer