Groovy,GPars, STS(Eclipse) and Maven?

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

Groovy,GPars, STS(Eclipse) and Maven?

Edward Zarecor
All,

I saw nothing in the archive related to this and, honestly, this is
probably not a GPars issues per se, but I thought someone might have
an idea what's going on.

I'm trying to get a Groovy[1.8.6], GPars[0.12] maven project working
properly STS [2.9.2].

I've tried with both GMaven and the built in Eclipse Maven
integration.  I've seen this blog post,
http://glaforge.appspot.com/article/building-your-groovy-2-0-projects-with-maven,
by  Guillaume Laforge, a member here I believe, and have tried both
configurations.

While the project seems to resolve dependencies and build OK, Groovy
scripts that utilize withPool won't run within Eclipse.

I get the following Exception:


Caught: groovy.lang.MissingMethodException: No signature of method:
static groovyx.gpars.GParsPool.withPool() is applicable for argument
types: (org.indeterminate.example.gpar.Test$_run_closure1) values:
[org.indeterminate.example.gpar.Test$_run_closure1@38c1cd75]
Possible solutions: withPool(groovy.lang.Closure), withPool(int,
groovy.lang.Closure), withPool(int,
java.lang.Thread$UncaughtExceptionHandler, groovy.lang.Closure),
with(groovy.lang.Closure)
groovy.lang.MissingMethodException: No signature of method: static
groovyx.gpars.GParsPool.withPool() is applicable for argument types:
(org.indeterminate.example.gpar.Test$_run_closure1) values:
[org.indeterminate.example.gpar.Test$_run_closure1@38c1cd75]
Possible solutions: withPool(groovy.lang.Closure), withPool(int,
groovy.lang.Closure), withPool(int,
java.lang.Thread$UncaughtExceptionHandler, groovy.lang.Closure),
with(groovy.lang.Closure)
        at org.indeterminate.example.gpar.Test.run(Test.groovy:5)


However, creating a maven exec:java run configuration within Eclipse


that references the same script runs without issues.

Any thoughts would be greatly appreciated.

Ed.

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Groovy,GPars, STS(Eclipse) and Maven?

Russel Winder-3
Edward,

My suspicion is this may be an Eclipse Groovy compiler issue, hence
including Andrew and Andy in the CC (*). It is certainly the case that
the use of AST transforms in GPars means that STS is unable to compile
GPars.

Currently if using Eclipse for Groovy/GPars code I always use a Gradle
build, generate the Eclipse project from it, but always do the builds
from a command line not from inside Eclipse. The STS Gradle tooling is
broken for me just now.

Actually I always use Gradle to hold all project information.

For GPars related code I tend to build an IntelliJ IDEA project from the
Gradle file and use IntelliJ IDEA. Currently IntelliJ IDEA is far more
usable for Groovy work that Eclipse, it can work by using the internal
build system or managing Gradle builds (actually it can m,anage Maven
builds as well just as Eclipse can). But I still dislike the IntelliJ
IDEA look and feel, far preferring Eclipse. This is to do with widget
and especially font rendering on GNOME. Eclipse does it well, IntelliJ
IDEA significantly less so.

You might want to stop using Maven and start using Gradle ;-)

I appreciate this doesn't answer your question, it more tries to suggest
positive workarounds.

(*) Though they may just tell me I am wrong!

On Wed, 2012-07-25 at 16:39 -0400, Edward Zarecor wrote:

> All,
>
> I saw nothing in the archive related to this and, honestly, this is
> probably not a GPars issues per se, but I thought someone might have
> an idea what's going on.
>
> I'm trying to get a Groovy[1.8.6], GPars[0.12] maven project working
> properly STS [2.9.2].
>
> I've tried with both GMaven and the built in Eclipse Maven
> integration.  I've seen this blog post,
> http://glaforge.appspot.com/article/building-your-groovy-2-0-projects-with-maven,
> by  Guillaume Laforge, a member here I believe, and have tried both
> configurations.
>
> While the project seems to resolve dependencies and build OK, Groovy
> scripts that utilize withPool won't run within Eclipse.
>
> I get the following Exception:
>
>
> Caught: groovy.lang.MissingMethodException: No signature of method:
> static groovyx.gpars.GParsPool.withPool() is applicable for argument
> types: (org.indeterminate.example.gpar.Test$_run_closure1) values:
> [org.indeterminate.example.gpar.Test$_run_closure1@38c1cd75]
> Possible solutions: withPool(groovy.lang.Closure), withPool(int,
> groovy.lang.Closure), withPool(int,
> java.lang.Thread$UncaughtExceptionHandler, groovy.lang.Closure),
> with(groovy.lang.Closure)
> groovy.lang.MissingMethodException: No signature of method: static
> groovyx.gpars.GParsPool.withPool() is applicable for argument types:
> (org.indeterminate.example.gpar.Test$_run_closure1) values:
> [org.indeterminate.example.gpar.Test$_run_closure1@38c1cd75]
> Possible solutions: withPool(groovy.lang.Closure), withPool(int,
> groovy.lang.Closure), withPool(int,
> java.lang.Thread$UncaughtExceptionHandler, groovy.lang.Closure),
> with(groovy.lang.Closure)
>         at org.indeterminate.example.gpar.Test.run(Test.groovy:5)
>
>
> However, creating a maven exec:java run configuration within Eclipse
>
>
> that references the same script runs without issues.
>
> Any thoughts would be greatly appreciated.
>
> Ed.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Groovy,GPars, STS(Eclipse) and Maven?

Russel Winder-3
In reply to this post by Edward Zarecor
<<Andrew Eisenberg is having a (hopefully temporary) problem injecting
into this list. He asked me to do a manual thingy, which seems entirely
reasonable :-) >>

---------- Forwarded message ----------
From: Andrew Eisenberg <[hidden email]>
Date: Thu, Jul 26, 2012 at 6:30 AM
Subject: Re: [gpars-user] Groovy,GPars, STS(Eclipse) and Maven?
To: Russel Winder <[hidden email]>
Cc: "[hidden email]" <[hidden email]>, Andrew
Eisenberg <
[hidden email]>, Andy Clement <[hidden email]>


What happens when you run as a java app? Instead of a groovy script?
[…]

--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Groovy,GPars, STS(Eclipse) and Maven?

Edward Zarecor
>
>
> What happens when you run as a java app? Instead of a groovy script?
> […]
>

Eclipse does't believe that the Groovy script the or generated Java
stub are executable: "Selection does not contain a main type." The
script and the generated java source do, however, contain static void
main methods.

Were you hoping this would be illustrative of something or another
possible work-around?

Thanks.

Ed.

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

    http://xircles.codehaus.org/manage_email