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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      v 1.12 @ hudson 1.348
    • Similar Issues:
      Show 5 results

      Description

      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)

        Attachments

          Issue Links

            Activity

            Hide
            rdesgroppes Régis Desgroppes added a comment -

            Same for me. However, when rolling back, you will face other exceptions:

            Mar 4, 2010 1:57:22 PM hudson.util.RobustCollectionConverter populateCollection
            WARNING: Failed to resolve class
            com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.scm.SVNRevisionState : hudson.scm.SVNRevisionState

            Regis

            Show
            rdesgroppes Régis Desgroppes added a comment - Same for me. However, when rolling back, you will face other exceptions: Mar 4, 2010 1:57:22 PM hudson.util.RobustCollectionConverter populateCollection WARNING: Failed to resolve class com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.scm.SVNRevisionState : hudson.scm.SVNRevisionState Regis
            Hide
            daniel_franzen daniel_franzen added a comment -

            Same issue for me; started when upgrading to SVN Plugin 1.12.

            Show
            daniel_franzen daniel_franzen added a comment - Same issue for me; started when upgrading to SVN Plugin 1.12.
            Hide
            rainerweinhold rainerweinhold added a comment -

            Restore pervious Version: renaming subversion.bak to subversion.hpi works for me.

            Show
            rainerweinhold rainerweinhold added a comment - Restore pervious Version: renaming subversion.bak to subversion.hpi works for me.
            Hide
            alacenaire alacenaire added a comment -

            Same issue, renaming subversion.bak to subversion.hpi didn't work for me. I had to remove subversion plugin files and come back to Hudson 1.347 (that seems to include the version 1.11 of the subversion plugin)

            Show
            alacenaire alacenaire added a comment - Same issue, renaming subversion.bak to subversion.hpi didn't work for me. I had to remove subversion plugin files and come back to Hudson 1.347 (that seems to include the version 1.11 of the subversion plugin)
            Hide
            anilc anilc added a comment -

            I was able to restore by renaming subversion.bak to subversion.hpi

            Show
            anilc anilc added a comment - I was able to restore by renaming subversion.bak to subversion.hpi
            Hide
            lcantey lcantey added a comment - - edited

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

            Show
            lcantey lcantey added a comment - - edited Reverting to subversion.bak didn't appear on first poll to work but is now working for me.
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            abayer 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.

            Show
            abayer 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.
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            jglick 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
            
            Show
            jglick 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            jglick 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?

            Show
            jglick 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?
            Hide
            jenkins_mizuho 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

            Show
            jenkins_mizuho 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
            Hide
            recena Manuel Recena Soto added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: