Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 15:29 Go to next message
Lloyd Meinholz is currently offline Lloyd MeinholzFriend
Messages: 3
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 05:12 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
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 13:53 Go to previous messageGo to next message
Lloyd Meinholz is currently offline Lloyd MeinholzFriend
Messages: 3
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 17:14 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
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 17:29 Go to previous messageGo to next message
Rohit Kumar is currently offline Rohit KumarFriend
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 19:50 Go to previous messageGo to next message
Eduardo Rodrigues is currently offline Eduardo RodriguesFriend
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 13:45 Go to previous messageGo to next message
k z is currently offline k zFriend
Messages: 71
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 18:27 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
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 11:07 Go to previous messageGo to next message
k z is currently offline k zFriend
Messages: 71
Registered: October 2012
Member
Yes, it works now.
Re: Execute system Groovy script not working with Hudson 3.0 [message #1062089 is a reply to message #1015185] Wed, 05 June 2013 20:50 Go to previous messageGo to next message
Lloyd Meinholz is currently offline Lloyd MeinholzFriend
Messages: 3
Registered: February 2013
Junior Member
Something I just discovered about this issue that is weird. The problem exists on Solaris, but does not exist on Linux. I have the same versions of the hudson-groovy-builder (1.13-h-1) and the Groovy-Support-Plugin (3.0.3) on both my Linux and Solaris boxes. I create a simple job that executes the same script and get the error on my Solaris install but not on the Linux install.

The JDK versions are different, but I do not have admin access to the Solaris box.

Is there something different about how Hudson is executing a script on Solaris?

uname -a gives me:

SunOS hostname 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V440
Re: Execute system Groovy script not working with Hudson 3.0 [message #1064147 is a reply to message #1053516] Mon, 17 June 2013 19:59 Go to previous messageGo to next message
Nicolas Morissette is currently offline Nicolas MorissetteFriend
Messages: 1
Registered: June 2013
Junior Member
Hi, I had the same problem when upgrading to hudson 3.0.1-b2. I added all my job to the postbuil section "Groovy Postbuild" and it works this way except that "println" command don't show in the log anymore. Is that still possible to make the "build" steps of the groovy plugin to work again?

Thank you Smile
Re: Execute system Groovy script not working with Hudson 3.0 [message #1107737 is a reply to message #1052860] Thu, 12 September 2013 21:40 Go to previous messageGo to next message
Carlton Brown is currently offline Carlton BrownFriend
Messages: 2
Registered: September 2013
Junior Member
I can reproduce this error in Hudson: 3.0.1-b2 with the following steps:
0. Clean install of Hudson
1. Install the recommended plugins Hudson BIRT, JNA Native Support, XPath provider
2. Install Hudson Groovy Builder 1.13-h-1. Successfully test that a groovy script works
3. Install parameterized-trigger 2.17-h-1 which apparently causes groovy-support 3.0.3 to be installed

As a result I get the following stacktrace when executing a build with a system groovy script step:

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:82)
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 #1111217 is a reply to message #1107737] Wed, 18 September 2013 00:16 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Carlton, thanks for steps to reproduce. I will look in to this issue

Winston Prakash
Eclipse Hudson team
Re: Execute system Groovy script not working with Hudson 3.0 [message #1111257 is a reply to message #1111217] Wed, 18 September 2013 01:45 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi 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

https://dl.dropboxusercontent.com/u/13144273/groovy-1.13-h-2-SNAPSHOT.hpi

https://dl.dropboxusercontent.com/u/13144273/Groovy-builder-test1.png

https://dl.dropboxusercontent.com/u/13144273/Groovy-builder-test2.png



Winston Prakash
Eclipse Hudson team
Re: Execute system Groovy script not working with Hudson 3.0 [message #1111268 is a reply to message #1111257] Wed, 18 September 2013 02:08 Go to previous messageGo to next message
Carlton Brown is currently offline Carlton BrownFriend
Messages: 2
Registered: September 2013
Junior Member
Winston Prakash wrote on Tue, 17 September 2013 21:45
Hi 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)
Re: Execute system Groovy script not working with Hudson 3.0 [message #1111751 is a reply to message #1111268] Wed, 18 September 2013 17:29 Go to previous message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Can you send the settings of your Job to my e-mail (winston DOT prakash AT gmail DOT com). Let us take this offline and post the results here when we have a solution.

Winston Prakash
Eclipse Hudson team
Previous Topic:Artifactory-Plugin 3.0.3 and permissions
Next Topic:dashboard-view does not show projects
Goto Forum:
  


Current Time: Thu Mar 28 12:52:45 GMT 2024

Powered by FUDForum. Page generated in 0.06334 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top