The following exception is reported when Bamboo tries to cast to String a list of values:
SEVERE: Servlet.service() for servlet default threw exception java.lang.ClassCastException:
java.util.ArrayList cannot be cast to java.lang.String
at com.atlassian.bamboo.utils.ConfigUtils.copyMapToConfig(ConfigUtils.java:30)
at com.atlassian.bamboo.fieldvalue.BuildDefinitionConverter.fromObject(BuildDefinitionConverter.java:135)
at com.atlassian.bamboo.ww2.interceptors.BuildConfigurationEditInterceptor.intercept(BuildConfigurationEditInterceptor.java:41)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
public class ConfigUtils
{
private static final Logger log = Logger.getLogger(ConfigUtils.class);
public static void copyMapToConfig(Map map, Configuration config)
{
for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();)
{
Map.Entry entry = (Map.Entry) iterator.next();
String key = (String) entry.getKey();
String value = (String) entry.getValue();
config.setProperty(key, value);
}
}
Printing the value that caused the problem (Key and Value):
2010-10-29 09:52:26,106 DEBUG [BAM::Bamboo Server Agent::Agent:pool-4-thread-1] [ConfigUtils] custom.sysbliss.success.command
2010-10-29 09:52:26,106 DEBUG [BAM::Bamboo Server Agent::Agent:pool-4-thread-1] [ConfigUtils] [, ]
Equivalent DB XML code (BuildDefinition table)
<sysbliss>
<pre>
<command/>
<command>
<run><location>A</location></run>
</command>
</pre>
<failed>
<command/>
<command/>
</failed>
<success>
<command/>
<command/>
</success>
<post>
<command>
<run><location>A</location></run>
</command>
</post>
</sysbliss>
The problem above is from the Pre-Post Build Command Runner plugin. However it also happened to the Clearcase plugin (Key and Value):
custom.repository.cc.dynamicView
[true, true]