Dependency Error when try to inject ActiveObject to plugin class constructor

I tried to inject ActiveObject into the constructor of my plugin class. Build succeed, but throughs run-time error as follows:

  • [c.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'com.atlassian.util.concurrent.LazyReference$InitializationException - org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'linkedin.commits.tabpanels.CommitsIssueTabPanel': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.activeobjects.external.ActiveObjects]: : No qualifying bean of type [com.atlassian.activeobjects.external.ActiveObjects] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.activeobjects.external.ActiveObjects] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}'

 

2 answers

1 accepted

This widget could not be displayed.

I solved the problem with following 2 step

  1. Add @Scanned annotation for the plugin class
  2. Add @ComponentImport annotation for the plugin class constructor

Notice: No need to add <component-import> section in atlassian-plugin.xml

 

This widget could not be displayed.

i was having this issue when I was running the unit tests. 

Basically, i was using Spring Junit runner to run my tests and had a test application context taht was doing a scan for all annotations.

I ended up excluding the classes injecting AO from the component scan as I will be using ActiveObect test runner to run unit tests for these classes. 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

115 views 2 0
Join discussion

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