UnsatisfiedDependencyException

Lance Wong March 29, 2012

in my report plugin, i extended AbstractSearchRequestExcelView and to start off with, its exactly the same code as the atlassian class: SearchRequestExcelViewCurrentFields

i get an UnsatisfiedDependencyException as shown here:

com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.xeroxxls.jira.plugins.search.SearchRequestXLSPrjTrackExcel': Unsatisfied dependency expressed through constructor argument with index 3 of type [com.atlassian.jira.web.component.TableLayoutFactory]: : No unique bean of type [com.atlassian.jira.web.component.TableLayoutFactory] is defined:

do i need to inject the TableLayoutFactory into my constructor? (i attempted this but im not too familiar with this Spring injection stuff either) or maybe i need to declare it as a component in my plugin?

this is the extended class:

public class SearchRequestXLSPrjTrackExcel extends AbstractSearchRequestExcelView

{

    private TableLayoutFactory tableLayoutFactory;

    private SearchRequestViewBodyWriterUtil searchRequestViewBodyWriterUtil;

    

    public SearchRequestXLSPrjTrackExcel(JiraAuthenticationContext authenticationContext, SearchProvider searchProvider, ApplicationProperties appProperties, TableLayoutFactory tableLayoutFactory, SearchRequestViewBodyWriterUtil searchRequestViewBodyWriterUtil)

    {

        super(authenticationContext, searchProvider, appProperties, tableLayoutFactory, searchRequestViewBodyWriterUtil);

        this.tableLayoutFactory = tableLayoutFactory;

        this.searchRequestViewBodyWriterUtil = searchRequestViewBodyWriterUtil;

    }



    protected IssueTableLayoutBean getColumnLayout(SearchRequest searchRequest, User user)

    {

        return tableLayoutFactory.getStandardExcelLayout(searchRequest, user);

    }

}

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
ConradR
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.
August 12, 2013

You have to remove TableLayoutFactory tableLayoutFactory from your constructor and use ComponentAccessor.getComponent(TableLayoutFactory.class) instead as parameter for your super() call.

TAGS
AUG Leaders

Atlassian Community Events