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

hudson.scm.CVSChangeLogSet$CVSChangeLog cannot be cast to hudson.plugins.mercurial.MercurialChangeSet

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      My server's log file is filled with exceptions:

      Oct 6, 2009 9:55:07 AM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: browser.getChangeSetLink(c). Reason:
      java.lang.ClassCastException: hudson.scm.CVSChangeLogSet$CVSChangeLog cannot be
      cast to hudson.plugins.mercurial.MercurialChangeSet
      java.lang.ClassCastException: hudson.scm.CVSChangeLogSet$CVSChangeLog cannot be
      cast to hudson.plugins.mercurial.MercurialChangeSet
      at hudson.plugins.mercurial.browser.HgWeb.getChangeSetLink(HgWeb.java:21)
      at sun.reflect.GeneratedMethodAccessor1090.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
      at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
      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:72)
      at org.apache.commons.jelly.tags.core.SetTag.doTag(SetTag.java:84)
      ...

      I have no idea what is causing these or what I am supposed to do to fix it. The
      stack trace gives no clue what the originating URL was, making it hard to track
      down the problem.

      I checked jobs/*/config.xml. Most jobs use MercurialSCM; a couple use CVSSCM.
      Three use NullSCM but their builds/*/changelog.xml contain just '<log/>'.

      Looking through sources, this in AbstractBuild.java is pretty suspicious:

      if(scm==null)
      scm = new CVSChangeLogParser();

      Shouldn't ChangeLogSet.createEmpty(this) just be returned in this case? Or scm
      set to new NullChangeLogParser(), probably the same thing? The field comment says

      /**

      • SCM used for this build.
      • Maybe null, for historical reason, in which case CVS is assumed.
        */
        private ChangeLogParser scm;

      but I wonder if this (old?) compatibility measure is causing problems now.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          CC.

          Show
          jglick Jesse Glick added a comment - CC.
          Hide
          jglick Jesse Glick added a comment -

          Even after the CVS support was moved into its own plugin, AbstractBuild in core still tries to load CVSChangeLogParser by reflection. This seems dangerous. Can this compatibility code be removed now?

          Show
          jglick Jesse Glick added a comment - Even after the CVS support was moved into its own plugin, AbstractBuild in core still tries to load CVSChangeLogParser by reflection. This seems dangerous. Can this compatibility code be removed now?
          Hide
          danielbeck Daniel Beck added a comment -

          It's probably time.

          Show
          danielbeck Daniel Beck added a comment - It's probably time.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          core/src/main/java/hudson/model/AbstractBuild.java
          http://jenkins-ci.org/commit/jenkins/58a5d2249deb2abfa6e0c4e7854ac2fc2f3fc1b7
          Log:
          JENKINS-4610 - Remove historical CVS code in the ChangeLogParser initialization (#2248)

          • Fix whitespace issue
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: core/src/main/java/hudson/model/AbstractBuild.java http://jenkins-ci.org/commit/jenkins/58a5d2249deb2abfa6e0c4e7854ac2fc2f3fc1b7 Log: JENKINS-4610 - Remove historical CVS code in the ChangeLogParser initialization (#2248) Remove CVS historical code - JENKINS-4610 Fix whitespace issue
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Released as Jenkins-2.4

          Show
          oleg_nenashev Oleg Nenashev added a comment - Released as Jenkins-2.4

            People

            • Assignee:
              ionutdiaconu ionut diaconu
              Reporter:
              jglick Jesse Glick
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: