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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • Platform: All, OS: All

    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

          jglick Jesse Glick added a comment -

          CC.

          jglick Jesse Glick added a comment - CC.
          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?

          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?
          danielbeck Daniel Beck added a comment -

          It's probably time.

          danielbeck Daniel Beck added a comment - It's probably time.

          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
          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
          oleg_nenashev Oleg Nenashev added a comment -

          Released as Jenkins-2.4

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

          People

            ionutdiaconu ionut diaconu
            jglick Jesse Glick
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: