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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

78 views 0 11
Read article

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