Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Problem with cascadingselectsearcher for custom cascading select derived field

Nick Seegmiller April 15, 2013

I've created a new version of the cascading select custom field, that is essentially an admin-only version. It is based very heavily on the admin-only text field that is used in the JIRA tutorials. We have that admin-only text field in place and have it working fine. Also, the actual field I've created functions as intended, where I run into trouble is with the searcher.

I've added a customfield-searcher block to my atlassian-plugin.xml that is basically a copy of what is in system-customfieldtypes-plugin.xml for the cascadingselectsearcher with my new field added as a valid-customfield-type. Here's the XML:

<customfield-searcher key="cascadingselectsearcher" name="Cascading Select Searcher" i18n-name-key="admin.customfield.searcher.cascadingselectsearcher.name" class="com.atlassian.jira.issue.customfields.searchers.CascadingSelectSearcher">
	<description key="admin.customfield.searcher.cascadingselectsearcher.desc">Search for multiple values using two select lists.</description>
	<resource type="velocity" name="search" location="templates/plugins/fields/edit-searcher/search-cascadingselect.vm"/>
	<resource type="velocity" name="view" location="templates/plugins/fields/view-searcher/view-searcher-option.vm"/>
	<valid-customfield-type package="com.spillman.jira.toolkit" key="admin-only-cascading-field"/>
</customfield-searcher>

This is very similar to what I've done for my other fields and seems like it *should* work. The plugin builds fine, but when I go to the edit screen for the custom field in question so I can set the searcher for the field, I get this error:

2013-04-11 09:38:11,609 http-bio-8080-exec-14 ERROR nseegmiller 578x4749x1 10ipit0 10.240.17.97 /secure/admin/EditCustomField!default.jspa [atlassian.plugin.module.PrefixDelegatingModuleFactory] Detected an error instantiating the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. See http://confluence.atlassian.com/x/kgL3CQ  for more details.
2013-04-11 09:38:11,609 http-bio-8080-exec-14 ERROR nseegmiller 578x4749x1 10ipit0 10.240.17.97 /secure/admin/EditCustomField!default.jspa [atlassian.plugin.manager.DefaultPluginManager] Exception when retrieving plugin module cascadingselectsearcher
com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.atlassian.jira.issue.customfields.searchers.CascadingSelectSearcher': 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

This is followed by a call stack in the LazyReference class. Also, please note that the Confluence link in that is dead. Despite that, I did my very best to try to add the <component-import> I thought it was asking for and tried adding both of these to my atlassian-plugin.xml

&lt;component-import key="componentLocator"&gt;
	&lt;description&gt;Component Locator&lt;/description&gt;
	&lt;interface&gt;com.atlassian.sal.api.component.ComponentLocator&lt;/interface&gt;
&lt;/component-import&gt;

Which I believe is the correct way, using the SAL. As well as this block, which is more directly inline with what it seems to be asking:

&lt;component-import key="componentLocator"&gt;
	&lt;description&gt;Component Locator&lt;/description&gt;
	&lt;interface&gt;com.atlassian.jira.util.ComponentLocator&lt;/interface&gt;
&lt;/component-import&gt;

With either of those two blocks in place, I can't even get the plugin to enable, and in fact, the error I get when I install it basically non-existant. When I manually try to enable to plugin, I get this:

2013-04-12 08:28:06,193 Spring executor 42 ERROR nseegmiller 508x12843x1 10shuc1 10.240.17.97 /rest/plugins/1.0/com.spillman.jira.toolkit-key [plugin.osgi.factory.OsgiPlugin] Unable to start the Spring context for plugin com.spillman.jira.toolkit
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'componentLocator': FactoryBean threw exception on object creation; nested exception is org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127)

So obviously my next thought was to add cglib as a depencency in my pom.xml file, but as far as I could tell, it didn't at all change the behavior.

I feel like I'm trying WAY too hard here and this should be easy, since it was quite easy to do something similar for other field types. Anybody have any experience here? Thanks.

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
JPB August 3, 2014

Look here Mathias:

https://answers.atlassian.com/questions/178292/error-creating-bean-with-name-dependency-on-jira-api-type?page=1#322286

A little late, maybe you already solve that, but it can be useful for others with the same problem.

0 votes
codelab expert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 5, 2013

Do you have a solution? I have the same problem...

0 votes
Andrey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2013

Looks like it is the same error i desricbed here: https://answers.atlassian.com/questions/162682/customfield-searcher-problems

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events