| 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 |