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.
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.
Cheers,
Steffen
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.