Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Null TemplateRenderer in BaseBuildConfigurationAwarePlugin sub-class when using Spring Scanner

I have a pretty simple Bamboo plugin that was created using 'atlas-create-bamboo-plugin', however, now that I am adding some configuration I am hitting a null pointer due to 'getTemplateRenderer()' in 'BaseBuildConfigurationAwarePlugin' returning 'null'.

I have this in 'atlassian-plugin.xml':

<additionalBuildConfigurationPlugin key="configuration" class="com.orgname.bamboo.githubStatus.Configuration">
<resource type="freemarker" name="edit" location="config/edit.ftl" />
</additionalBuildConfigurationPlugin>

and com.orgname.bamboo.githubStatus.Configuration is implemented as:

package com.orgname.bamboo.githubStatus;

import
com.atlassian.bamboo.plan.Plan;
import com.atlassian.bamboo.plan.cache.ImmutablePlan;
import com.atlassian.bamboo.plan.configuration.MiscellaneousPlanConfigurationPlugin;
import com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin;

public class
Configuration extends BaseBuildConfigurationAwarePlugin implements MiscellaneousPlanConfigurationPlugin {
@Override
public boolean isApplicableTo(@NotNull ImmutablePlan immutablePlan) {
return true;
}
}

I have tried overriding 'getEditHtml()' to track down that the NPE is happening in this line (and that getTemplateRenderer() is returning null):

return this.getTemplateRenderer().render(templatePath, context);

By way of experiment, I have tried adding this to my Configuration class:

@Inject
private TemplateRenderer myInternalRenderer;

and this fails with:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.orgname.bamboo.githubStatus.Configuration': Unsatisfied dependency expressed through field 'myInternalRenderer'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.bamboo.template.TemplateRenderer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}

I am not sure where to take this from here, so any suggestions very much appreciated.

1 answer

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 31, 2023 • edited

Hi @Chris Cormack,

 

App development related questions are best asked in the Atlassian Developer Community, you have a greater chance to get feedback from other app developers there.

 

The question at hand seems to be appropriate for the Atlassian Developer Tools category, even though there is also a Bamboo Development category for solely Bamboo related questions. 

  • To set expectations regarding the latter, you'll note that there are comparatively few Bamboo related questions - regardless, quite some Atlassian team members are monitoring the community by now, so hopefully they can loop in someone from the Bamboo team.

 

Cheers,

Steffen

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events