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

Investigate why Bamboo can't cast Plugin data to String

    • Icon: Suggestion 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.

      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]
      

            [BAM-7267] Investigate why Bamboo can't cast Plugin data to String

            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3377313 ] New: JAC Suggestion Workflow 3 [ 3610479 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Monique Khairuliana (Inactive) made changes -
            Backlog Order (Obsolete) Original: 10700000000
            Workflow Original: Bamboo Workflow 2016 v1 - Restricted [ 1441747 ] New: JAC Suggestion Workflow [ 3377313 ]
            Issue Type Original: Story [ 16 ] New: Suggestion [ 10000 ]
            Alexey Chystoprudov made changes -
            Resolution New: Timed out [ 10 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            Owen made changes -
            Workflow Original: Bamboo Workflow 2016 v1 [ 1417926 ] New: Bamboo Workflow 2016 v1 - Restricted [ 1441747 ]
            Marek Went (Inactive) made changes -
            Workflow Original: Bamboo Workflow 2014 v2 [ 609595 ] New: Bamboo Workflow 2016 v1 [ 1417926 ]
            James Dumay made changes -
            Workflow Original: Bamboo Workflow 2014 [ 602565 ] New: Bamboo Workflow 2014 v2 [ 609595 ]
            James Dumay made changes -
            Workflow Original: Bamboo Workflow 2010 [ 267809 ] New: Bamboo Workflow 2014 [ 602565 ]
            Renan Battaglin made changes -
            Issue Type Original: Task [ 3 ] New: Story [ 16 ]
            Renan Battaglin created issue -

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

                Created:
                Updated:
                Resolved: