Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Inject PlanExecutionManager does not work! Edited

Hello,

I have Bamboo task. Everything works fine untill I want to inject service or manager.

I want to inject PlanExecutionManager so I write

public class MyFirstTask implements TaskType {

private final PlanExecutionManager execution_manager

@Inject /** or Autowire */
public MyFirstTask(@ComponentImport PlanExecutionManager manager) {
execution_manager = manager;
}

@Override
public TaskResult execute(final TaskContext context) {... }

}

But when I run the Task, the following errir is printed to the build log

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bimproject.bamboo.task.MyFirstTask': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.bamboo.plan.PlanExecutionManager]: : No qualifying bean of type [com.atlassian.bamboo.plan.PlanExecutionManager] 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.bamboo.plan.PlanExecutionManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

 

How Can I Inject PlanExecutionManager to the task?

 

Thanks for any advice

John

 

1 answer

1 accepted

0 votes
Answer accepted

Hello,

I found the solution

@Scanned /** <======= */
public
class MyFirstTask implements TaskType {
...
}

 Just add @Scanned to class definition.

But! The @Scanned is marked as deprecated by documentation 

https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/

So - Is my solution right?

 

Thanks,

John

Depends on which scanner version you're using because for versions 2.0+:

Remove use of @Scanned - this feature is removed. All classes are now scanned.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center - Early Access Program

G’day Bamboo customers, The wait is almost over! We are in the final stages of work on the first release of Bamboo Data Center, our self-managed enterprise offering of Bamboo. This Data Center offe...

1,097 views 0 16
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you