Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Hudson » Execute system Groovy script not working with Hudson 3.0(Execute system Groovy script not working with Hudson 3.0)
Execute system Groovy script not working with Hudson 3.0 [message #1014318] Mon, 25 February 2013 10:29 Go to next message
Lloyd Meinholz is currently offline Lloyd Meinholz
Messages: 2
Registered: February 2013
Junior Member
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 #1014582 is a reply to message #1014318] Tue, 26 February 2013 00:12 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 142
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi Lloyd, Groovy has been removed from core and moved to a plugin called groovy-support plugin. If you install that plugin, it should work as before.

If you still see any problem after installing groovy-support plugin, I will look in to the issue.


Winston Prakash
Eclipse Hudson team
Re: Execute system Groovy script not working with Hudson 3.0 [message #1014806 is a reply to message #1014582] Tue, 26 February 2013 08:53 Go to previous messageGo to next message
Lloyd Meinholz is currently offline Lloyd Meinholz
Messages: 2
Registered: February 2013
Junior Member
I do have the groovy-support plugin installed. I reduced the groovy script to only a single println and even that failed.
Re: Execute system Groovy script not working with Hudson 3.0 [message #1015185 is a reply to message #1014806] Wed, 27 February 2013 12:14 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 142
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Please file a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Hudson. I will look into this. I'm guessing you are also using groovy plugin along with groovy-support plugin. Do you have the latest version of both the plugins

groovy-support-plugin: 3.0.3
groovy-plugin: 1.13-h-1


Winston Prakash
Eclipse Hudson team
Re: Execute system Groovy script not working with Hudson 3.0 [message #1016045 is a reply to message #1015185] Mon, 04 March 2013 12:29 Go to previous messageGo to next message
Rohit Kumar is currently offline Rohit Kumar
Messages: 1
Registered: March 2013
Junior Member
Hi, Do you have any idea how to make the groovy postbuild plugin on hudson 3.0?
Re: Execute system Groovy script not working with Hudson 3.0 [message #1043497 is a reply to message #1015185] Wed, 17 April 2013 15:50 Go to previous messageGo to next message
Eduardo Rodrigues is currently offline Eduardo Rodrigues
Messages: 1
Registered: April 2013
Junior Member
Hi,

I'm facing exactly the same issue. I'm on Hudson 3.0.1-b2 and using groovy-support-plugin: 3.0.3 and groovy-plugin: 1.13-h-1 and Groovy 1.8.2

Are there any updates on this issue? Is there a bug already filed for it?

Tks,
Eduardo.
Re: Execute system Groovy script not working with Hudson 3.0 [message #1049947 is a reply to message #1043497] Fri, 26 April 2013 09:45 Go to previous messageGo to next message
k z is currently offline k z
Messages: 46
Registered: October 2012
Member
Hi,

Groovy Postbuild Plugin 1.3
Groovy Support Plugin 3.0.3

When I tried groovy postbuild plugin I got following exception. WHat is the problem?

Building remotely on enriqos
FATAL: groovy/lang/GroovyShell
java.lang.NoClassDefFoundError: groovy/lang/GroovyShell
	at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:227)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:34)
	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:646)
	at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:624)
	at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:600)
	at hudson.model.Build$RunnerImpl.post2(Build.java:163)
	at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:566)
	at hudson.model.Run.run(Run.java:1414)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
	at hudson.model.ResourceController.execute(ResourceController.java:82)
	at hudson.model.Executor.run(Executor.java:137)
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyShell
	at org.aspectj.weaver.bcel.ExtensibleURLClassLoader.findClass(ExtensibleURLClassLoader.java:54)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	... 11 more


Regards!
Re: Execute system Groovy script not working with Hudson 3.0 [message #1052860 is a reply to message #1049947] Tue, 30 April 2013 14:27 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 142
Registered: August 2011
Location: Fremont, CA USA
Senior Member
I fixed this issue and released Groovy Post build Plugin 1.9-h-1. Please let us know if it works.

Winston Prakash
Eclipse Hudson team
Re: Execute system Groovy script not working with Hudson 3.0 [message #1053516 is a reply to message #1052860] Mon, 06 May 2013 07:07 Go to previous message
k z is currently offline k z
Messages: 46
Registered: October 2012
Member
Yes, it works now.
Previous Topic:hudson-ci.org machines will be down for maintenace
Next Topic:Is Hudson WAR wrong version?
Goto Forum:
  


Current Time: Sat May 18 22:46:33 EDT 2013

Powered by FUDForum. Page generated in 0.01795 seconds