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

java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • subversion-plugin
    • None
    • v 1.12 @ hudson 1.348

      I just installed the v1.12 of the plugin and it fails with this error. I have to go back to 1.11

      Mar 4, 2010 9:43:45 AM hudson.triggers.SCMTrigger$Runner runPolling
      SEVERE: Failed to record SCM polling
      java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
      at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1051)
      at hudson.scm.SCM.poll(SCM.java:342)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1150)
      at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:319)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:348)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      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:619)

          [JENKINS-5827] java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState

          lcantey added a comment - - edited

          Reverting to subversion.bak didn't appear on first poll to work but is now working for me.

          lcantey added a comment - - edited Reverting to subversion.bak didn't appear on first poll to work but is now working for me.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/28405
          Log:
          JENKINS-5827 Tentative fix for ClassCastException

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/28405 Log: JENKINS-5827 Tentative fix for ClassCastException

          Andrew Bayer added a comment -

          For what it's worth - running a build of each project will get rid of the problem, but we're working on a real fix as we speak.

          Andrew Bayer added a comment - For what it's worth - running a build of each project will get rid of the problem, but we're working on a real fix as we speak.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/main/war/pom.xml
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/28445
          Log:
          [FIXED JENKINS-5827] Fixed ClassCastException - live in svn plugin 1.13 which will be bundled with 1.350

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/war/pom.xml trunk/www/changelog.html http://jenkins-ci.org/commit/28445 Log: [FIXED JENKINS-5827] Fixed ClassCastException - live in svn plugin 1.13 which will be bundled with 1.350

          Jesse Glick added a comment - - edited

          Kohsuke agreed that this seems like a type error in the core, which every SCM impl should not have to work around separately. A possible patch:

          Index: core/src/main/java/hudson/scm/SCM.java
          ===================================================================
          --- core/src/main/java/hudson/scm/SCM.java	(revision 28468)
          +++ core/src/main/java/hudson/scm/SCM.java	(working copy)
          @@ -346,6 +346,9 @@
                * Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs.
                */
               public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
          +        if (baseline == SCMRevisionState.NONE) {
          +            return PollingResult.BUILD_NOW;
          +        }
                   try {
                       return _compareRemoteRevisionWith(project, launcher, workspace, listener, baseline);
                   } catch (AbstractMethodError e) {// pre 1.345 SCM that doesn't implement new polling methods
          

          Jesse Glick added a comment - - edited Kohsuke agreed that this seems like a type error in the core, which every SCM impl should not have to work around separately. A possible patch: Index: core/src/main/java/hudson/scm/SCM.java =================================================================== --- core/src/main/java/hudson/scm/SCM.java (revision 28468) +++ core/src/main/java/hudson/scm/SCM.java (working copy) @@ -346,6 +346,9 @@ * Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs. */ public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException { + if (baseline == SCMRevisionState.NONE) { + return PollingResult.BUILD_NOW; + } try { return _compareRemoteRevisionWith(project, launcher, workspace, listener, baseline); } catch (AbstractMethodError e) {// pre 1.345 SCM that doesn't implement new polling methods

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/main/core/src/main/java/hudson/scm/SCM.java
          http://jenkins-ci.org/commit/28470
          Log:
          [JENKINS-5827, JENKINS-5756] This approach fixes both bugs in one fell swoop

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/core/src/main/java/hudson/scm/SCM.java http://jenkins-ci.org/commit/28470 Log: [JENKINS-5827, JENKINS-5756] This approach fixes both bugs in one fell swoop

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/main/core/src/main/java/hudson/scm/SCM.java
          http://jenkins-ci.org/commit/28471
          Log:
          [JENKINS-5827, JENKINS-5756] Whoops - missed something I had intended.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/core/src/main/java/hudson/scm/SCM.java http://jenkins-ci.org/commit/28471 Log: [JENKINS-5827, JENKINS-5756] Whoops - missed something I had intended.

          Jesse Glick added a comment -

          For what it's worth, I am running a snapshot build containing Kohsuke's latest 28499 and have not so far observed either JENKINS-5827 or JENKINS-5756. Near time for 1.350 to be released?

          Jesse Glick added a comment - For what it's worth, I am running a snapshot build containing Kohsuke's latest 28499 and have not so far observed either JENKINS-5827 or JENKINS-5756 . Near time for 1.350 to be released?

          Jose Arevalo added a comment -

          I updated to the latest version of the plugin and I am seeing the issue:

          At revision 3327
          FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
          java.lang.ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
          at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:726)
          at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:861)
          at hudson.scm.SCM.checkout(SCM.java:485)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
          at hudson.model.Run.execute(Run.java:1741)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:408)
          Finished: FAILURE

          Jose Arevalo added a comment - I updated to the latest version of the plugin and I am seeing the issue: At revision 3327 FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState java.lang.ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:726) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:861) at hudson.scm.SCM.checkout(SCM.java:485) at hudson.model.AbstractProject.checkout(AbstractProject.java:1277) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Finished: FAILURE

          jenkins_mizuho, Could you clean up your workspace? Which working copy version are you using?

          Manuel Recena Soto added a comment - jenkins_mizuho , Could you clean up your workspace? Which working copy version are you using?

            recena Manuel Recena Soto
            aheritier Arnaud Héritier
            Votes:
            17 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: