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.

          [JENKINS-21578] CCE since ${jobs} includes non-Job's

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/resources/hudson/plugins/view/dashboard/DashboardPortlet/index.jelly
          http://jenkins-ci.org/commit/dashboard-view-plugin/baa8c5043072c6cc7a3cf44f002d55befd86f1c5
          Log:
          [FIXED JENKINS-21578] Ensure that ${jobs} is really a Collection<Job>, with no Folder for example.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/resources/hudson/plugins/view/dashboard/DashboardPortlet/index.jelly http://jenkins-ci.org/commit/dashboard-view-plugin/baa8c5043072c6cc7a3cf44f002d55befd86f1c5 Log: [FIXED JENKINS-21578] Ensure that ${jobs} is really a Collection<Job>, with no Folder for example.

          Code changed in jenkins
          User: Marco Ambu
          Path:
          src/main/resources/hudson/plugins/view/dashboard/DashboardPortlet/index.jelly
          http://jenkins-ci.org/commit/dashboard-view-plugin/0481b6f2ef6ea09c376f94566f566772d504e69f
          Log:
          Merge pull request #23 from jglick/folder-CCE-JENKINS-21578

          [FIXED JENKINS-21578] Ensure that ${jobs} is really a Collection<Job>

          Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/d1801567045a...0481b6f2ef6e

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marco Ambu Path: src/main/resources/hudson/plugins/view/dashboard/DashboardPortlet/index.jelly http://jenkins-ci.org/commit/dashboard-view-plugin/0481b6f2ef6ea09c376f94566f566772d504e69f Log: Merge pull request #23 from jglick/folder-CCE- JENKINS-21578 [FIXED JENKINS-21578] Ensure that ${jobs} is really a Collection<Job> Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/d1801567045a...0481b6f2ef6e

          Carsten Otto added a comment -

          Please also have a look at https://github.com/jenkinsci/dashboard-view-plugin/pull/40 which solves a very similar issue.

          PS: Your login captchas are WAY too hard. Furthermore, the generated passwords use I and l which are hard/impossible to differentiate. Logging in cost me about five minutes!

          Carsten Otto added a comment - Please also have a look at https://github.com/jenkinsci/dashboard-view-plugin/pull/40 which solves a very similar issue. PS: Your login captchas are WAY too hard. Furthermore, the generated passwords use I and l which are hard/impossible to differentiate. Logging in cost me about five minutes!

          Code changed in jenkins
          User: Carsten Otto
          Path:
          src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly
          http://jenkins-ci.org/commit/dashboard-view-plugin/18ef5137e8aba0d50e0fc256171ddf06ecf106af
          Log:
          Ensure that ${jobs} is really a Collection<Job>

          Similar to JENKINS-21578 and PR #23

          Example problem:

          WARNING: Caught exception evaluating: it.getTotal(jobs) in /jenkins/. Reason: java.lang.ClassCastException: com.github.mjdetullio.jenkins.plugins.multibranch.MavenMultiBranchProject cannot be cast to hudson.model.Job
          java.lang.ClassCastException: com.github.mjdetullio.jenkins.plugins.multibranch.MavenMultiBranchProject cannot be cast to hudson.model.Job
          at hudson.plugins.analysis.collector.dashboard.WarningsTablePortlet.getTotal(WarningsTablePortlet.java:366)
          at sun.reflect.GeneratedMethodAccessor410.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Carsten Otto Path: src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly http://jenkins-ci.org/commit/dashboard-view-plugin/18ef5137e8aba0d50e0fc256171ddf06ecf106af Log: Ensure that ${jobs} is really a Collection<Job> Similar to JENKINS-21578 and PR #23 Example problem: WARNING: Caught exception evaluating: it.getTotal(jobs) in /jenkins/. Reason: java.lang.ClassCastException: com.github.mjdetullio.jenkins.plugins.multibranch.MavenMultiBranchProject cannot be cast to hudson.model.Job java.lang.ClassCastException: com.github.mjdetullio.jenkins.plugins.multibranch.MavenMultiBranchProject cannot be cast to hudson.model.Job at hudson.plugins.analysis.collector.dashboard.WarningsTablePortlet.getTotal(WarningsTablePortlet.java:366) at sun.reflect.GeneratedMethodAccessor410.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497)

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

              Created:
              Updated:
              Resolved: