[JIRA] [subversion-plugin] (JENKINS-27079) ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState

188 views
Skip to first unread message

ogondza@gmail.com (JIRA)

unread,
Jun 5, 2015, 4:37:01 AM6/5/15
to jenkinsc...@googlegroups.com
Oliver Gondža resolved as Duplicate
 
Jenkins / Bug JENKINS-27079
ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
Change By: Oliver Gondža
Status: Open Resolved
Resolution: Duplicate
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jose.arevalo@mizuhocbus.com (JIRA)

unread,
Sep 23, 2015, 8:53:02 AM9/23/15
to jenkinsc...@googlegroups.com
Jose Arevalo reopened an issue
 

Issue still exists in the latest version:

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

Change By: Jose Arevalo
Resolution: Duplicate
Status: Resolved Reopened

jose.arevalo@mizuhocbus.com (JIRA)

unread,
Sep 23, 2015, 8:57:02 AM9/23/15
to jenkinsc...@googlegroups.com
Jose Arevalo commented on Bug JENKINS-27079
 
Re: ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState

latest version still has the same issue. It was moved a bit down the lines:

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

recena@gmail.com (JIRA)

unread,
Sep 23, 2015, 9:54:01 AM9/23/15
to jenkinsc...@googlegroups.com

anthony.mastrean@gmail.com (JIRA)

unread,
Oct 20, 2015, 5:03:03 PM10/20/15
to jenkinsc...@googlegroups.com
Anthony Mastrean updated an issue
 
Change By: Anthony Mastrean
After updating to Jenkins 1.599/Subversion plugin 2.5, every other build of various jobs throws the exception

{code}
Updating svn://... at revision '2015-02-22T22:24:56.096 +0100'
At revision 224551
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:725)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
at hudson.scm.SCM.checkout(SCM.java:484)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
at hudson.model.Run.execute(Run.java:1718)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)

{code}

anthony.mastrean@gmail.com (JIRA)

unread,
Oct 20, 2015, 5:04:03 PM10/20/15
to jenkinsc...@googlegroups.com
Anthony Mastrean commented on Bug JENKINS-27079
 
Re: ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState

I run Jenkins 1.633 with the Subversion plugin 2.5. When I checkout a large repository (100K+ revisions) in a configuration with a clean workspace (this seems important?), I get the following...

FATAL: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
	at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725)
	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
	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)

anthony.mastrean@gmail.com (JIRA)

unread,
Oct 20, 2015, 5:05:03 PM10/20/15
to jenkinsc...@googlegroups.com
Anthony Mastrean edited a comment on Bug JENKINS-27079
I run Jenkins 1.633 with the Subversion plugin 2.5. When I checkout a large repository (100K+ revisions) in a configuration with a clean workspace (this seems important?), I get the following  error .  The second run of the same configuration seems to always succeed . .

{code}

FATAL: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
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)
{code}

anthony.mastrean@gmail.com (JIRA)

unread,
Oct 20, 2015, 5:08:05 PM10/20/15
to jenkinsc...@googlegroups.com
Anthony Mastrean edited a comment on Bug JENKINS-27079
I run Jenkins 1.633 with the Subversion plugin 2.5. When I checkout a large repository (100K+ revisions) in a configuration with a clean workspace (this seems important?), I get the following error. The second run of the same configuration seems to always succeed.


{code}
FATAL: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState
at hudson.scm.SubversionSCM.calcChangeLog(SubversionSCM.java:725)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:860)
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)
{code}


It always seems to checkout (using update as much as possible) to the top-level directory, which indicates a complete checkout. Then it fails :(

{code}
 U        .
At revision 107500
{code}

rodrigc@FreeBSD.org (JIRA)

unread,
Aug 4, 2016, 4:16:02 PM8/4/16
to jenkinsc...@googlegroups.com
Craig Rodrigues resolved as Cannot Reproduce
 

Cannot reproduce: Jenkins 2.16, multiple-scms 0.6, Subversion Plug-in 2.6

Change By: Craig Rodrigues
Status: Reopened Resolved
Resolution: Cannot Reproduce
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jeffdafoe@gmail.com (JIRA)

unread,
Sep 9, 2016, 4:43:01 PM9/9/16
to jenkinsc...@googlegroups.com
Jeff Dafoe commented on Bug JENKINS-27079
 
Re: ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState

We just switched from Git to SVN and I can repro this on the first build of every project as I switch them to SVN. The first build fails with the error Anthony Mastrean posted and similar to his experience, subsequent builds work fine. If it's any help, our SVN repo is on revision 1 and has no changes currently.

jeffdafoe@gmail.com (JIRA)

unread,
Sep 9, 2016, 4:44:03 PM9/9/16
to jenkinsc...@googlegroups.com
Jeff Dafoe reopened an issue
 

Reopening, can repro consistently.

Change By: Jeff Dafoe
Resolution: Cannot Reproduce
Status: Resolved Reopened

YanSioux@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:22:09 AM12/26/18
to jenkinsc...@googlegroups.com
Yan Pak commented on Bug JENKINS-27079
 
Re: ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState

I had the same problem. Every n-th build was failed with ClassCastException error.

I have resolved this issue by changing code in the hudson.scm.SubversionSCM.java

Source code I took there http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/subversion/2.12.1/

Was:

 

boolean created;
try {
    created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");

Become:

 

boolean created = false;
try {
    if(baseline instanceof SVNRevisionState){
        created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
    }
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");

As you can see I added class check.

I don't know is it absolutely right way to fix this problem, cause I don't have a whole application architecture view in my mind. It's strange that sometimes argument for new SubversionChangeLogBuilder got not castable to SVNRevisionState. Think this is flaw in the class modelling or plugin development.

Good thing that the algorythm of this method permits also no creation of changes log (the purpoise of this failing (sometimes) method is the creation of a changes log after a checkout or an update operation), so I can think that if baseline do not casting into SVNRevisionState then result of this method should not be look as succesful creation of changes log object (created is false).

 

My solution is simple. I don't know why developers still didn't realize this way. I hope, they are looking for class modelling flaw as I mentioned above, or something deeper, if any.
Hope I will soon accepted as project member and could pull a request with my changes into Github. Now I have my own fixed subversion.jpi If want - write me there.

I tested my solution. Works fine!
No more errors like
FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
If anybody will want to take

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

YanSioux@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:29:05 AM12/26/18
to jenkinsc...@googlegroups.com
Yan Pak edited a comment on Bug JENKINS-27079
I had the same problem. Every n-th build was failed with ClassCastException error.

I have resolved this issue by changing code in the hudson.scm.SubversionSCM.java


boolean created;
try {
    created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}
 

Become:

 
{code:java}

boolean created = false;
try {
    if(baseline instanceof SVNRevisionState){
        created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
    }
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}

As you can see I added class check.

I don't know is it absolutely right way to fix this problem, cause I don't have a whole application architecture view in my mind. It's strange that sometimes argument for new SubversionChangeLogBuilder got not castable to SVNRevisionState. Think this is flaw in the class modelling or plugin development.

Good thing that the algorythm of this method permits also +no+ creation of changes log (the purpoise of this failing (sometimes) method is the creation of a changes log after a checkout or an update operation), so I can think that if baseline do not casting into SVNRevisionState then result of this method should not be look as succesful creation of changes log object (+created+ is false).


 

My solution is simple. I don't know why developers still didn't realize this way. I hope, they are looking for class modelling flaw as I mentioned above, or something deeper, if any.
Hope I will soon accepted as project member and could pull a request with my changes into Github. Now I have my own fixed subversion.jpi :) If want - write me there.

I tested my solution. *Works fine!*
*No more errors* like

FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
If anybody will want to take

YanSioux@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:29:06 AM12/26/18
to jenkinsc...@googlegroups.com
Yan Pak edited a comment on Bug JENKINS-27079
I had the same problem. Every n-th build was failed with ClassCastException error.

I have resolved this issue by changing code in the hudson.scm.SubversionSCM.java

Was:

 
{code:java}
boolean created;
try {
    created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}
Become:

 
{code:java}
boolean created = false;
try {
    if(baseline instanceof SVNRevisionState){
        created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
    }
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}
As you can see I added class check.

I don't know is it absolutely right way to fix this problem, cause I don't have a whole application architecture view in my mind. It's strange that sometimes argument for new SubversionChangeLogBuilder got not castable to SVNRevisionState. Think this is flaw in the class modelling or plugin development.

Good thing that the algorythm of this method permits also +no+ creation of changes log (the purpoise of this failing (sometimes) method is the creation of a changes log after a checkout or an update operation), so I can think that if baseline do not casting into SVNRevisionState then result of this method should not be look as succesful creation of changes log object (+created+ is false). {color:#808080}
{color}

 

My solution is simple. I don't know why developers still didn't realize this way. I hope, they are looking for class modelling flaw as I mentioned above, or something deeper, if any.
Hope I will soon accepted as project member and could pull a request with my changes into Github. Now I have my own fixed subversion.jpi :) If want - write me there.

I tested my solution. *Works fine!*
*No more errors* like
FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
If anybody will want to take

YanSioux@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:30:03 AM12/26/18
to jenkinsc...@googlegroups.com
Yan Pak edited a comment on Bug JENKINS-27079
I had the same problem. Every n-th build was failed with ClassCastException error.

I have resolved this issue by changing code in the hudson.scm.SubversionSCM.java



 

Was:
{code:java}
boolean created;
try {
    created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}
 

Become:
{code:java}
boolean created = false;
try {
    if(baseline instanceof SVNRevisionState){
        created = new SubversionChangeLogBuilder(build, workspace, (SVNRevisionState) baseline, env, listener, this).run(externalsMap, new StreamResult(os));
    }
} finally {
    os.close();
}
if(!created)
    createEmptyChangeLog(changelogFile, listener, "log");
{code}
As you can see I added class check.

I don't know is it absolutely right way to fix this problem, cause I don't have a whole application architecture view in my mind. It's strange that sometimes argument for new SubversionChangeLogBuilder got not castable to SVNRevisionState. Think this is flaw in the class modelling or plugin development.

Good thing that the algorythm of this method permits also +no+ creation of changes log (the purpoise of this failing (sometimes) method is the creation of a changes log after a checkout or an update operation), so I can think that if baseline do not casting into SVNRevisionState then result of this method should not be look as succesful creation of changes log object (+created+ is false).

 

My solution is simple. I don't know why developers still didn't realize this way. I hope, they are looking for class modelling flaw as I mentioned above, or something deeper, if any.
Hope I will soon accepted as project member and could pull a request with my changes into Github. Now I have my own fixed subversion.jpi :) If want - write me there here .


I tested my solution. *Works fine!*
*No more errors* like
FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState
If anybody will want to take

YanSioux@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:59:02 AM12/26/18
to jenkinsc...@googlegroups.com
Yan Pak edited a comment on Bug JENKINS-27079
I had the same problem. Every n-th build was failed with ClassCastException error.

I have resolved solved this issue by changing code in the hudson.scm.SubversionSCM.java


 

My
So, this gives me hope that my solution is simple valid at last . I don't know why developers still didn't realize this way. I hope, they are looking for class modelling flaw as I mentioned above, or something deeper, if any.
Hope

I hope my pull request #228 will soon accepted as project member and could pull a request with my changes into Github . Now I have my own fixed subversion.jpi :) If want - write me here.


I tested my solution. *Works fine!*
*No more errors* like

FATAL
: _FATAL: hudson.scm.SVNRevisionState cannot be cast to hudson.scm. SVNRevisionState
If anybody will want to take
SVNRevisionState_

YanSioux@gmail.com (JIRA)

unread,
Dec 27, 2018, 7:48:04 AM12/27/18
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 12, 2019, 8:41:04 AM7/12/19
to jenkinsc...@googlegroups.com

There are several distinct exception messages here, which are likely unrelated:

  • java.lang.ClassCastException: org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState cannot be cast to hudson.scm.SVNRevisionState sounds like a bug in the Multiple SCMs plugin. Please file separately with steps to reproduce from scratch if you have them.
  • java.lang.ClassCastException: hudson.scm.SCMRevisionState$None cannot be cast to hudson.scm.SVNRevisionState might be a bug in this plugin, or in Jenkins core. Smells like an upgrade problem, or a problem with the first build of a job, or something like that. Please file separately with steps to reproduce from scratch if you have them.
  • The originally reported java.lang.ClassCastException: hudson.scm.SVNRevisionState cannot be cast to hudson.scm.SVNRevisionState which suggests a problem in class loading—two copies of the Subversion plugin being loaded under different names, or some other plugin copying classes from this one for unknown reasons. To begin diagnosis, try bisecting your $JENKINS_HOME/plugins/ directory, or it may be possible to use /script to inspect resources multiply available from UberClassLoader.
Reply all
Reply to author
Forward
0 new messages