I have a plugin that implements a multi-select custom field type. I want to make this custom field searchable. I've referred to this and this but i'm still having an issue with unresolved dependency. Plugin is version 2. This is what I have:
atlassian-plugin.xml:
<customfield-searcher key="multiselectsearcher" name="Multi Select Searcher" i18n-name-key="admin.customfield.searcher.multiselectsearcher.name"
class="org.cmp.jira.plugin.MSSearcher">
<description key="admin.customfield.searcher.multiselectsearcher.desc">Search for multiple values using a single select list.</description>
<resource type="velocity" name="search" location="templates/search-multiselect.vm"/>
<resource type="velocity" name="view" location="templates/view-searcher-multioption.vm"/>
<resource type="velocity" name="label" location="templates/label-searcher-basictext.vm"/>
<valid-customfield-type package="org.cmp.jira.plugin.crm" key="my-clients"/>
</customfield-searcher>
MSSearcher:
public class MSSearcher extends MultiSelectSearcher{
public MSSearcher(ComponentLocator componentLocator, ComponentFactory componentFactory) {
super(componentLocator, componentFactory) ;
}
}
Any tips?
The above answer has syntax errors. The proper constructor is:
public MSSearcher() { super(new JiraComponentLocator(),JiraComponentFactory.getInstance()); }
Also, please be aware that this is a workaround for a known issue: https://jira.atlassian.com/browse/JRA-20403
Modify your searcher constructor like this:
public MSSearcher(){ super(new JiraComponentLocator(), JiraComponentFactory.getInstance()) ; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the exact error? e.g. which dependency is it having a problem with?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Error:
com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.cmp.jira.plugin.MSSearcher': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.jira.util.ComponentLocator]: : No unique bean of type [com.atlassian.jira.util.ComponentLocator] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.util.ComponentLocator]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.atlassian.jira.util.ComponentLocator] is defined: Unsatisfied dependency of type [interface com.atlassian.jira.util.ComponentLocator]: expected at least 1 matching bean
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.