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

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

Accepted Answer
0 votes

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.

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..

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
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

120 views 6 8
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you