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

View: when "Recurse in subfolders" is true, view is empty and logs full of java.lang.ClassCastException: hudson.maven.MavenModule cannot be cast to hudson.model.TopLevelItem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Jenkins 1.515, Dashboard view version 1.6, Debian Squeeze, Java 1.6.0_37

      One of my dashboard view is defined like the following

          <hudson.plugins.view.dashboard.Dashboard plugin="dashboard-view@2.5">
            <owner class="hudson" reference="../../.."/>
            <name>+Continuous Integration</name>
            <filterExecutors>false</filterExecutors>
            <filterQueue>false</filterQueue>
            <properties class="hudson.model.View$PropertyList"/>
            <jobNames>
              <comparator class="hudson.util.CaseInsensitiveComparator"/>
            </jobNames>
            <jobFilters/>
            <columns>
              <hudson.views.StatusColumn/>
              <hudson.views.WeatherColumn/>
              <hudson.views.JobColumn/>
              <hudson.views.LastSuccessColumn/>
              <hudson.views.LastFailureColumn/>
              <hudson.views.LastDurationColumn/>
              <hudson.views.BuildButtonColumn/>
              <de.fspengler.hudson.pview.ConsoleViewColumn plugin="hudson-pview-plugin@1.8"/>
              <hudson.plugins.projectstats.column.NumBuildsColumn plugin="project-stats-plugin@0.4"/>
            </columns>
            <includeRegex>(?!(_env_.*|.*single_selenium_test.*|stx2|apache|check|nexus|ocs)).*</includeRegex>
            <recurse>true</recurse>
            <useCssStyle>false</useCssStyle>
            <includeStdJobList>false</includeStdJobList>
            <leftPortletWidth>50%</leftPortletWidth>
            <rightPortletWidth>50%</rightPortletWidth>
            <leftPortlets/>
            <rightPortlets/>
            <topPortlets>
              <hudson.plugins.view.dashboard.core.JobsPortlet>
                <id>dashboard_portlet_6828</id>
                <name>Jobs Grid</name>
              </hudson.plugins.view.dashboard.core.JobsPortlet>
            </topPortlets>
            <bottomPortlets/>
          </hudson.plugins.view.dashboard.Dashboard>
      

      When I try to load this view, the job list is empty. The logs are full of the following exception:

      WARNING: Caught exception evaluating: it.allViewJobNamesAsJson in /jenkins/. Reason: java.lang.reflect.InvocationTargetException
      java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
              at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
              at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
              at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
              at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
              at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
              at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
              at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
              at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
              at org.apache.commons.jelly.parser.EscapingExpression.evaluate(EscapingExpression.java:24)
              at org.apache.commons.jelly.impl.ExpressionScript.run(ExpressionScript.java:66)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
              at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
              at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
              at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
              at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
              at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
              at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
              at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
              at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:666)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:736)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:214)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
              at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
              at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
              at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:86)
              at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:84)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
              at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
              at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
              at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
              at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
              at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
              at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
              at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)
              at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.ClassCastException: hudson.maven.MavenModule cannot be cast to hudson.model.TopLevelItem
              at hudson.model.ListView.includeItems(ListView.java:194)
              at hudson.model.ListView.includeItems(ListView.java:196)
              at hudson.model.ListView.includeItems(ListView.java:189)
              at hudson.model.ListView.getItems(ListView.java:160)
              at hudson.model.ListView.getItems(ListView.java:63)
              at org.jenkins.ci.plugins.keyboard_shortcuts.KeyboardShortcutsPageDecorator.getAllViewJobNamesAsJson(KeyboardShortcutsPageDecorator.java:90)
              ... 99 more
      

      As soon as I set "recurse" parameter to false, the view is working as expected. It took me a few days to spot this issue and it annoyed a lot my users, so I think the view should deal with this improper parameter correctly.

            vlatombe Vincent Latombe
            rborer Reynald Borer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: