没有 [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator] 类型的合格 bean
No qualifying bean of type [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator]
我开始开发一个 Jira 外部系统导入程序插件,我应该使用它的设置页面上传一个 JSON 文件,但是当我将“TemporaryAttachmentsMonitorLocator”添加到我的 SetupPage class 构造函数时,我点击我的进口商的按钮,它失败并出现错误:“没有 [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator] 类型的合格 bean”
[INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dev.addax.jira.plugins.trello2jira.web.TrelloSetupPage': Unsatisfied dependency expressed through constructor argument with index 4 of type [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator]: No qualifying bean of type [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator] 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.jira.issue.TemporaryAttachmentsMonitorLocator] 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=)}
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
public class TrelloSetupPage extends AbstractSetupPage {
private final TemporaryAttachmentsMonitorLocator locator;
public TrelloSetupPage(@ComponentImport UsageTrackingService usageTrackingService, @ComponentImport WebInterfaceManager webInterfaceManager,
@ComponentImport PluginAccessor pluginAccessor, @ComponentImport EventPublisher eventPublisher,
@ComponentImport TemporaryAttachmentsMonitorLocator locator) {
super(usageTrackingService, webInterfaceManager, pluginAccessor, eventPublisher);
this.locator = locator;
}
// ... other content omitted.
}
我的构造函数中的其他参数已正确解析。只有这个失败了。如果我删除 class 我可以按预期导航到我的 SetupPage。
最后,class 由 OSGi 系统包导出,我检查过它甚至仍被 Jira 本机 JIM 插件用作服务。
知道找不到这个 class 的原因是什么吗?
我删除了 @ComponentImport TemporaryAttachmentsMonitorLocator locator
并添加了
ComponentAccessor.getOSGiComponentInstanceOfType(TemporaryAttachmentsMonitorLocator.class)
在构造函数体中。
我不知道为什么 @ComponentImport 不适用于这种情况,但解决方法非常有效。
我开始开发一个 Jira 外部系统导入程序插件,我应该使用它的设置页面上传一个 JSON 文件,但是当我将“TemporaryAttachmentsMonitorLocator”添加到我的 SetupPage class 构造函数时,我点击我的进口商的按钮,它失败并出现错误:“没有 [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator] 类型的合格 bean”
[INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dev.addax.jira.plugins.trello2jira.web.TrelloSetupPage': Unsatisfied dependency expressed through constructor argument with index 4 of type [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator]: No qualifying bean of type [com.atlassian.jira.issue.TemporaryAttachmentsMonitorLocator] 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.jira.issue.TemporaryAttachmentsMonitorLocator] 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=)}
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
public class TrelloSetupPage extends AbstractSetupPage {
private final TemporaryAttachmentsMonitorLocator locator;
public TrelloSetupPage(@ComponentImport UsageTrackingService usageTrackingService, @ComponentImport WebInterfaceManager webInterfaceManager,
@ComponentImport PluginAccessor pluginAccessor, @ComponentImport EventPublisher eventPublisher,
@ComponentImport TemporaryAttachmentsMonitorLocator locator) {
super(usageTrackingService, webInterfaceManager, pluginAccessor, eventPublisher);
this.locator = locator;
}
// ... other content omitted.
}
我的构造函数中的其他参数已正确解析。只有这个失败了。如果我删除 class 我可以按预期导航到我的 SetupPage。
最后,class 由 OSGi 系统包导出,我检查过它甚至仍被 Jira 本机 JIM 插件用作服务。
知道找不到这个 class 的原因是什么吗?
我删除了 @ComponentImport TemporaryAttachmentsMonitorLocator locator
并添加了
ComponentAccessor.getOSGiComponentInstanceOfType(TemporaryAttachmentsMonitorLocator.class)
在构造函数体中。
我不知道为什么 @ComponentImport 不适用于这种情况,但解决方法非常有效。