Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21578

CCE since ${jobs} includes non-Job's

XMLWordPrintable

      A user with a dashboard view in a folder containing a hudson.plugins.checkstyle.dashboard.WarningsTablePortlet reports an exception in the log:

      hudson.ExpressionFactory2$JexlExpression evaluate 
      WARNING: Caught exception evaluating: it.getWarnings(jobs, 'LOW') in /job/.../view/dashboard/. Reason: java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.Folder cannot be cast to hudson.model.Job 
      java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.Folder cannot be cast to hudson.model.Job 
      at hudson.plugins.analysis.dashboard.AbstractWarningsTablePortlet.getWarnings(AbstractWarningsTablePortlet.java:151)
      

      AbstractWarningsTablePortlet/portlet.jelly seems to assume, reasonably enough, that ${jobs} is in fact a Collection<Job<?,?>>; yet it is getting at least one Folder in there. The culprit seems to be DashboardPortlet/index.jelly which defines ${jobs} as a synonym for ${items}, which looks wrong.

            petehayes Peter Hayes
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: