Any Idea why i get this "is loadable from OSGi but no enabled plugins could autowire an instance" error.

SuhailM March 28, 2013

I am writint a service which extends AbstractService class.The purpose of this service is to send emails..

but when i try to add this service i get this error..

" Exception loading class: [Class 'com..mail.ArchiveEmailSenderService..is loadable from OSGi but no enabled plugins could autowire an instance" .

In my constructor-

public ArchiveEmailSenderService(ProjectManager projectManager, IssueManager issueManager, IssueIndexManager issueIndexManager, Locale locale, WebResourceManager resourceManager,
I18nHelper.BeanFactory beanFactory,ProjectStatistics projectStatistics) {
this.projectManager = projectManager;
this.searchProvider = ComponentManager.getInstance().getSearchProvider();
this.issueManager = issueManager;
this.issueIndexManager = issueIndexManager;
this.locale = locale;
this.resourceManager = resourceManager;
this.applicationProperties = ComponentAccessor.getApplicationProperties();
this.beanFactory = beanFactory;

}

ProjectStatistics projectStatistics - is my own class which i have used to inject via component module.(Pico injection..)

1 answer

1 accepted

0 votes
Answer accepted
Radu Dumitriu
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.
March 28, 2013

This usually happens if the ProjectStatistics has a constructor which cannot be used.

Make sure ProjectStatistics is declared as a bean (component) in your atlassian-plugin.xml and that its constructor is usable.

SuhailM March 28, 2013

Yes i have used in atlassian-plugin.xml and it was working fine until i added addional parameters in the constructor..

component key="archiveProject_component" class="com.mail.ProjectStatisticsImpl"
        public="true">
        <description>Provides project statistics.</description>
        <interface>com.mail.ProjectStatistics</interface>
    </component>

I also blocked/commented this component import code and tried but i still get the same error..

Radu Dumitriu
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.
March 28, 2013

There you go. Some of the added parameters are not good (who inject your Locale ? is the usual Locale or another service? also not sure about the I18nHelper.BeanFactory) .

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events