Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-7267

Investigate why Bamboo can't cast Plugin data to String

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Timed out
    • None
    • None
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      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]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rbattaglin Renan Battaglin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: