views:

678

answers:

4

Hello, I am new to Hudson, perhaps someone knows the solution: I am trying to checkout the parent pom from the VSS in Hudson (vss plugin installed) and now I get class cast exception:

FATAL: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build
    at scm.vss.VSSSCM.checkout(VSSSCM.java:227)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:664)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:260)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:234)
    at hudson.model.Run.run(Run.java:793)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:205)
    at hudson.model.ResourceController.execute(ResourceController.java:70)
    at hudson.model.Executor.run(Executor.java:88)

The line in question is here:

Build lastBuild = (Build)build.getPreviousBuild();

Has the interface changed? Anyone knows the solution?

A: 

Looks like it's a bug in that version of Hudson. Have you tried a slightly older or newer version? IIRC they provide very frequent stable builds, almost nightly...

fiddlesticks
A: 

Did anybody find an answer to the question above? I face the same issue.

Would appreciate any pointers.

Thanks in advance, Shashi

A: 

Hi there.

I've never faced that situation, but I have faced other problems when using maven projects in hudson like infinite loops upon builds and so (that I think Hudson itself should evaluate and avoid). By this I mean that this feature is quitely young and error-prone.

Regarding at your exception, I can advise you to configure the project as a freestyle software project. If you set up the "Execute maven top-level targets" option on the build steps, the project will be built using Maven and probably the exception will dissapear.

The other thing that Hudson does automatically when a project is configured as a maven project is triggering builds for dependent project on successfull build, but, you also can configure it manually by using the "Build other projects" feature.

As you see, it's a little configuration price to pay and I strongly think that your exception will dissapear.

Hope it helps.

Carlos

Carlos
+1  A: 

Looks like Shashi filed this as Hudson issue 2665 which remains open.

Michael Donohue