Getting error when trying to run System Groovy script on new File() call

142 views
Skip to first unread message

semitry801

unread,
Feb 27, 2015, 2:05:13 PM2/27/15
to jenkins...@googlegroups.com
A groovy script i'm trying to write to search the file system for an xml file throws the following error on new File call and i'm not sure why.  I imported java.io.* and hudson.FilePath.


ERROR: Processing failed due to a bug in the code. Please report this to jenkins...@googlegroups.com
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.io.File(hudson.FilePath)
	at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1491)
	at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1407)
	at org.codehaus.groovy.runtime.callsite.MetaClassConstructorSite.callConstructor(MetaClassConstructorSite.java:46)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
	at Script1.run(Script1.groovy:24)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:650)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:636)
	at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:93)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:915)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:866)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
	at hudson.model.Run.execute(Run.java:1759)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
	at hudson.model.ResourceController.execute(ResourceController.java:89)
	at hudson.model.Executor.run(Executor.java:240)

Any advice would be appreciated.

Thanks.

Reply all
Reply to author
Forward
0 new messages