Hi there,
I've new to Bamboo plugin development, so I have started to develop a Task type Plugin for Bamboo based on the example provided, which just prints a message into build log. I've added a Executable Type to it and want the user to select the Capability to be used by the Task. I have followed steps provided in Tasks Overview page. But, I'm getting the exception from freemarker. I'm new to Freemarker. Please guide on how to resolve this issue.
Thanks in advance,
Exception from log.
2013-06-26 14:20:17,378 ERROR [qtp690739569-139] [runtime] Expression uiConfigBean is undefined on line 2, column 104 in editBuildTask.ftl. Expression uiConfigBean is undefined on line 2, column 104 in editBuildTask.ftl. The problematic instruction: ---------- ==> user-directive ww.select [on line 2, column 1 in editBuildTask.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression uiConfigBean is undefined on line 2, column 104 in editBuildTask.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134) at freemarker.core.Dot._getAsTemplateModel(Dot.java:78) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:87) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.DefaultToExpression._getAsTemplateModel(DefaultToExpression.java:100) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:132) at freemarker.core.Environment.visit(Environment.java:210) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:210) at freemarker.core.Environment.process(Environment.java:190) at freemarker.template.Template.process(Template.java:289) at freemarker.template.Template.process(Template.java:243) at com.atlassian.bamboo.ww2.BambooFreemarkerManager.renderPage(BambooFreemarkerManager.java:465) at com.atlassian.bamboo.ww2.BambooFreemarkerManager.renderPage(BambooFreemarkerManager.java:385) at com.atlassian.bamboo.ww2.BambooFreemarkerManager.renderTemplateToString(BambooFreemarkerManager.java:631) at com.atlassian.bamboo.ww2.BambooFreemarkerManager.renderPage(BambooFreemarkerManager.java:351) at com.atlassian.bamboo.ww2.BambooFreemarkerManager.render(BambooFreemarkerManager.java:338) at com.atlassian.bamboo.ww2.actions.build.admin.config.task.TaskUIConfigBean.renderEditHtml(TaskUIConfigBean.java:112) at com.atlassian.bamboo.ww2.actions.build.admin.config.task.TaskUIConfigBean.prepareEditHtml(TaskUIConfigBean.java:90) at com.atlassian.bamboo.ww2.actions.build.admin.config.task.ConfigureBuildTasks.prepareEditHtml(ConfigureBuildTasks.java:152) at com.atlassian.bamboo.ww2.actions.build.admin.config.task.EditTask.doInput(EditTask.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Community moderators have prevented the ability to post new answers.
Finally got it working, but the setUIConfigBean or setUIConfigSupport methods are never called, instead the uiConfigBean was instantiated through the constructor. Mine looks like public MyTaskConfigurator(PluginSettingsFactory pluginSettingsFactory, UIConfigSupport uiConfigBean) None of the other plugins did it like this, but it's working on 5.8
Did you have to do anything else to make that bean injectable? On 6.6.x I get a Spring wiring exception stating there's no qualifying bean of that type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've added the context.put in both populate methods, yet I still get an exception when trying to access in my FTL. Why would the dependency injection not be working? I can't see any way to debug the problem either unless the setUiConfigBean() method isn't being called.
Update:
When populateContextForCreate() is called my uiConfigBean is NULL. Which would imply the method below is never being called.
public void setUiConfigBean( final UIConfigSupport uiConfigBean )
{
this.uiConfigBean = uiConfigBean;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In, your TaskConfigurator class, in populateContextForCreate and populateContextForEdit you need to add:
context.put("uiConfigBean", uiConfigBean); //assuming context is the name of the parameter
Background: those 2 methods defined variables that can be used during rendering of tasks's FTL pages. If you need to access a bean from ftl you need to add it to context.
The reference to uiConfigBean is acquired thanks to dependency injection: just define the field and the setter on your configurator class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.