Java Mailing List Archive

http://www.gg3721.com/

Home » eclipse-plugin-dev.groovy »

[groovy-eclipse-plugin-dev] Problem running a Groovy script from within Eclipse

Tom Harris

2012-06-21

Replies: Find Java Web Hosting

Author LoginPost Reply

Groovy-Eclipse plugin developers:

I have a pretty simple script I'm running, and I've been struggling to get it working for two days. Excerpt:


// some imports...

line 13: CustomConfigUtil.setPropertyFilename(args[0])

line 14: ConfigObject conf = CustomConfigUtil.getConf()

line 15: Log.info("conf=${conf}") // prints happy things, so we did in fact load the config data

line 16: CustomUtilObject customUtilObject = new CustomUtilObject(conf)

// etc...


When I attempt to run the script using the Run as... "Groovy Script" with the appropriate parameters and such, I see the conf=${conf} Log line with full data loaded, but then the error:

Caught: groovy.lang.GroovyRuntimeException: failed to invoke constructor: public CustomUtilObject(groovy.util.ConfigObject) with arguments: [] reason: java.lang.IllegalArgumentException: wrong number of arguments

groovy.lang.GroovyRuntimeException: failed to invoke constructor: public CustomUtilObject(groovy.util.ConfigObject) with arguments: [] reason: java.lang.IllegalArgumentException: wrong number of arguments

at MyScript.run(MyScript.groovy:16)


I have tried to use "new CustomUtilObject(conf: conf)" as well, same error.

The CustomUtilObject class in fact does have a single argument constructor:


    CustomUtilObject(ConfigObject conf) {

        this.conf = conf

    }


I'm at a complete loss as to why this is failing, and two days now have passed with no solution. Can anyone help? Thanks.


Tom Harris

Zemoga, Inc.


©2008 gg3721.com - Jax Systems, LLC, U.S.A.