GroovyEclipse fails to run

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GroovyEclipse fails to run

Carlos Cortinhas
Hello Groovy community,

I've got a bug that I cannot explain runningthe following code in Eclipse:

class Bidder {
     Auctioner auct = new Auctioner()
     void setAuct(Auctioner a){
         auct = a
     }
}
class Auctioner {
     static main(args) {
         Auctioner a = new Auctioner()
         Bidder b = new Bidder()
         b.setAuct(a)
     }
}

The code runs fine in command prompt as expected, but in Eclipse it
throws me this:

groovy.lang.MissingMethodException: No signature of method:
com.app.Bidder.setAuct() is applicable for argument types:
(com.app.Auctioner) values: [com.app.Auctioner@c7c991]
Possible solutions: setAuct(com.app.Auctioner), getAuct(),
getAt(java.lang.String)
The following classes appear as argument class and as parameter class,
but are defined by different class loader:
com.app.Auctioner (defined by
'groovy.lang.GroovyClassLoader$InnerLoader@12b24bc' and
'sun.misc.Launcher$AppClassLoader@197d257')
If one of the method suggestions matches the method you wanted to call,
then check your class loader setup.
     at com.app.Auctioner.main(Auctioner.groovy:10)

Is it something on my settings that I have to change? I've looked and
tried but I wasn't able to fix this yet. What am I missing?

Best regards,
Carlos

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GroovyEclipse fails to run

Andrew Eisenberg
Try running as a Java Application instead of a Groovy script.
Launching as a groovy script is meant as a way to launch individual
source scripts.  And requires a bit of munging with classloaders.
Circular referencing of groovy scripts can be problematic when
launching as a script. Besides, launching as a Java App will be
faster.

On Mon, Oct 14, 2013 at 4:42 AM, Carlos Cortinhas
<[hidden email]> wrote:

> class Bidder {
>     Auctioner auct = new Auctioner()
>     void setAuct(Auctioner a){
>         auct = a
>     }
> }
> class Auctioner {
>     static main(args) {
>         Auctioner a = new Auctioner()
>         Bidder b = new Bidder()
>         b.setAuct(a)
>     }
> }

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GroovyEclipse fails to run

Carlos Cortinhas
Argh, that easy, can't believe how I did not try that... Thanks!!!



Em 15-10-2013 05:43, Andrew Eisenberg escreveu:

> Try running as a Java Application instead of a Groovy script.
> Launching as a groovy script is meant as a way to launch individual
> source scripts.  And requires a bit of munging with classloaders.
> Circular referencing of groovy scripts can be problematic when
> launching as a script. Besides, launching as a Java App will be
> faster.
>
> On Mon, Oct 14, 2013 at 4:42 AM, Carlos Cortinhas
> <[hidden email]> wrote:
>> class Bidder {
>>      Auctioner auct = new Auctioner()
>>      void setAuct(Auctioner a){
>>          auct = a
>>      }
>> }
>> class Auctioner {
>>      static main(args) {
>>          Auctioner a = new Auctioner()
>>          Bidder b = new Bidder()
>>          b.setAuct(a)
>>      }
>> }
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email