Execute system Groovy script not working with Hudson 3.0 [message #1014318] |
Mon, 25 February 2013 10:29  |
Eclipse User |
|
|
|
Previous to hudson 3.0, I had been able to create build tasks using the Execute system Groovy script build step. The same scripts that were previously working are now failing. I am using the system Groovy script because I need access to the internal hudson objects, i.e. import hudson.model.*.
I read something about groovy being removed from hudson. Does that have anything to do with this and if so shouldn't the plugin add groovy? Or use the groovy that I have defined?
Here is the error message I am receiving. Thanks for any help or pointers.
FATAL: Failed to create Script instance for class: class Script1. Reason: java.lang.ClassCastException: Script1 cannot be cast to groovy.lang.GroovyObject
groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class Script1. Reason: java.lang.ClassCastException: Script1 cannot be cast to groovy.lang.GroovyObject
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:430)
at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
at groovy.lang.GroovyShell.parse(GroovyShell.java:723)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:680)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:666)
at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:79)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:34)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:646)
at hudson.model.Build$RunnerImpl.build(Build.java:181)
at hudson.model.Build$RunnerImpl.doRun(Build.java:136)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:434)
at hudson.model.Run.run(Run.java:1390)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
at hudson.model.ResourceController.execute(ResourceController.java:81)
at hudson.model.Executor.run(Executor.java:137)
Caused by: java.lang.ClassCastException: Script1 cannot be cast to groovy.lang.GroovyObject
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:408)
... 14 more
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Execute system Groovy script not working with Hudson 3.0 [message #1111268 is a reply to message #1111257] |
Tue, 17 September 2013 22:08   |
Eclipse User |
|
|
|
Winston Prakash wrote on Tue, 17 September 2013 21:45Hi Carlton, I wasn't able to reproduce this on Hudson 3.0.0. However, when I tried to build the groovy builder plugin with 3.0.1-b2, I noticed it wouldn't build because it uses older version of plexus-utils because we switched to use latest Plexus jars in 3.0.1-b2 to support JDK 7. Anyway, I was able to verify it works fine on Hudson 3.0.1-b2 (See the screenshots below). Can you test with my developer build
Hi Winston, thanks for looking into it. I saw the same stacktrace after removing the existing groovy plugin, installing the developer build, and restarting Hudson. Please let me know if you have any further ideas.
My JDK info is -
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
|
|
|
|
Powered by
FUDForum. Page generated in 0.52519 seconds