snovgorodsky | 23 Jul 00:27 2014

[groovy-user] Problem running execute() on string with a backslash

Hi -

I'm running execute() on a string that looks like this: " ldapsearch  -D
'some\name'  " (the rest of params are omitted for brevity). This is an LDAP
search utility, and it complains about invalid credentials which seems to be
caused by "\n" in the user name param. I can run exactly the same command
from a command line without problems.
I tried escaping the slash ("\\") and used all possible Groovy string
syntaxes - """, slashy strings, GStrings,  still getting the same problem.
Any ideas on how to work around this?


View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

Guillaume Laforge | 22 Jul 17:56 2014

[groovy-user] Groovy and Gradle among the 10 kick-ass technologies developers love

Hi there,

A report from RebelLabs puts Groovy and Grails among the 10 kick-ass technologies that developers love using:

Groovy reading...

Guillaume Laforge
Groovy Project Manager
Pivotal, Inc.

JamieEchlinCS | 22 Jul 11:00 2014

[groovy-user] trees, groovy golf


I need to generate a tree structure from a list of java packages, which I
read from a database. I am inspired by

This works great:

        def tree = { [:].withDefault{ } }
        def nSpacesTree = tree() = 1 = 1

My problem is I have the packages in the form of strings, like "".

The best I can do so far is:

        Eval.x(nSpacesTree, " = 1")

But eval doesn't seem very efficient. There must be a better way, seems like
I am missing an obvious trick.

cheers, jamie

View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

Behrang Saeedzadeh | 22 Jul 02:35 2014

[groovy-user] For loop inside a ConfigSlurper file? Or how to DRY-up this config file?


Is there a way to use a loop to create this config rather than explicitly creating one node per environment?

environments {

    'local' {
        author {
 user {
   admin {
                username = "local-admin"
                password = "local-pass"

    'test' {
        author {
 url = ""
 user {
   admin {
                username = "test-admin"
                password = "test-pass"

    // a bunch of other environments

Best regards,
maxdudu | 21 Jul 20:16 2014

[groovy-user] Disable cookie warnings from RESTClient

Hi guys

We are using a remote API and the server happens to send cookie with empty
names which is invalid.

This is not a problem for us except we see warnings about it, ex:
2014/07/21 18:17:14:050 UTC [WARN] ResponseProcessCookies - Invalid cookie
header: "Set-Cookie: ". Cookie name may not be empty

I am still learning groovy :) I would like some pointers on how to disable
the warning, we are using RESTClient object.


View this message in context:
Sent from the groovy - user mailing list archive at

To unsubscribe from this list, please visit:

Robert Rodini | 21 Jul 17:32 2014

[groovy-user] java and groovy (2.3) interoperability

I'm trying to demonstrated interoperability between java and groovy esp. groovy's new trait feature.

In my working directory i have these compiled files:
roberts-mbp-2:src Robert$ ls -l
total 144
-rw-r--r--  1 Robert  staff  4755 Jul 21 10:45 Athlete.class
-rw-r--r--  1 Robert  staff    21 Jul 21 10:43 Athlete.groovy
-rw-r--r--  1 Robert  staff  4574 Jul 21 10:45 BaseballPlayer.class
-rw-r--r--  1 Robert  staff    44 Jul 21 10:43 BaseballPlayer.groovy
-rw-r--r--  1 Robert  staff   763 Jul 21 10:45 Dominant.class
-rw-r--r--  1 Robert  staff    37 Jul 21 10:43
-rw-r--r--  1 Robert  staff   321 Jul 21 10:45 FootedNess$Trait$FieldHelper.class
-rw-r--r--  1 Robert  staff  6780 Jul 21 10:45 FootedNess$Trait$Helper.class
-rw-r--r--  1 Robert  staff   499 Jul 21 10:45 FootedNess.class
-rw-r--r--  1 Robert  staff   130 Jul 21 10:43 FootedNess.groovy
-rw-r--r--  1 Robert  staff   263 Jul 21 10:45 MainClass.class
-rw-r--r--  1 Robert  staff   200 Jul 21 10:53
-rw-r--r--  1 Robert  staff  6860 Jul 21 10:45 SoccerPlayer.class
-rw-r--r--  1 Robert  staff   135 Jul 21 10:43 SoccerPlayer.groovy

Note: SoccerPlayer extends Athlete implements FootedNess (a trait).

When I compile which creates a soccer player and then tries to call a trait method I get this compiler error (and some warnings):

roberts-mbp-2:src Robert$ javac -cp '.:$GROOVY_HOME/embeddable/groovy-all-2.3.1.jar'
./SoccerPlayer.class: warning: Cannot find annotation method 'traitClass()' in type 'Traits$TraitBridge': class file for org.codehaus.groovy.transform.trait.Traits$TraitBridge not found
./SoccerPlayer.class: warning: Cannot find annotation method 'desc()' in type 'Traits$TraitBridge'
./SoccerPlayer.class: warning: Cannot find annotation method 'traitClass()' in type 'Traits$TraitBridge'
./SoccerPlayer.class: warning: Cannot find annotation method 'desc()' in type 'Traits$TraitBridge'
./SoccerPlayer.class: warning: Cannot find annotation method 'traitClass()' in type 'Traits$TraitBridge'
./SoccerPlayer.class: warning: Cannot find annotation method 'desc()' in type 'Traits$TraitBridge' error: cannot access GroovyObject
sp1.kicking("soccer player");
  class file for groovy.lang.GroovyObject not found
1 error
6 warnings

I tried several different classpath values but cannot get past this error.   Any Suggestions?

--Bob Rodini
Russel Winder | 21 Jul 12:12 2014

[groovy-user] GroovyFX documentation push

Now that we have all the GroovyFX documentation in ASCIIDoctor form, I
guess the next push is to actually have more documentation! The source
is in the GroovyFX Git repository, all pull requests will be reviewed
and likely accepted.

Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at>
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w:  skype: russel_winder
Fedor Belov | 21 Jul 09:40 2014

[groovy-user] Groovy locks on String.indexOf

Hi. We are using Grails 2.2.4 and Groovy 2.0.8. We've fixed 2-4 major performance problems in Grails/Groovy. It works for months without any problems... And after months our server blocked with A LOT OF threads with the same stacktrace: 

"http-nio-8080-exec-11" daemon prio=10 tid=0x0000000005205800 nid=0x13d8 waiting for monitor entry [0x00002ae924474000] 
   java.lang.Thread.State: BLOCKED (on object monitor) 
        at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.proxy( 
        - waiting to lock <0x0000000600457e98> (a org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy) 
        at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod( 
        at groovy.lang.MetaClassImpl.chooseMethodInternal( 
        at groovy.lang.MetaClassImpl.chooseMethod( 
        at groovy.lang.MetaClassImpl.getMethodWithoutCaching( 
        at groovy.lang.MetaClassImpl.pickMethod( 
        at groovy.lang.MetaClassImpl.findOwnMethod( 
        at groovy.lang.MetaClassImpl.searchInterfacesForMetaMethod( 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy( 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy( 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy( 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy( 
        at groovy.lang.MetaClassImpl.invokeMissingMethod( 
        at groovy.lang.MetaClassImpl.invokePropertyOrMissing( 
        at groovy.lang.MetaClassImpl.invokeMethod( 
        at groovy.lang.ExpandoMetaClass.invokeMethod( 
        at groovy.lang.MetaClassImpl.invokeMethod( 
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall( 
        at java_lang_String$ Source) 
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe( 
        at org.grails.plugin.resource.ResourceTagLib.resolveLinkUriToUriAndResource(ResourceTagLib.groovy:552) 

How can we fix this problem? What's the reason of the problem?
zaantar | 20 Jul 11:46 2014

[groovy-user] ANT problems in mixed Groovy/Java project

I have a rather simple mixed Java/Groovy project for which I tried to generate Ant build file in Eclipse. Obviously that didn't work, but even after reading through Groovy Wiki and some forums I didn't find any working solution. I am stuck with this:

Buildfile: /home/zaantar/prg/blogparser/groovy-blogparser/build.xml
[mkdir] Created dir: /home/zaantar/prg/blogparser/groovy-blogparser/bin
[mkdir] Created dir: /home/zaantar/prg/blogparser/groovy-blogparser/dist
[copy] Copying 17 files to /home/zaantar/prg/blogparser/groovy-blogparser/bin
[echo] Blogparser: /home/zaantar/prg/blogparser/groovy-blogparser/build.xml
[groovyc] Compiling 15 source files to /home/zaantar/prg/blogparser/groovy-blogparser/bin
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] Compile error during compilation with javac.
[groovyc] /home/zaantar/prg/blogparser/groovy-blogparser/src/blogparser/ error: cannot find symbol
[groovyc] blogparser.Main.parse(blogNameField.getText(), outputPathField.getText(), logger);
[groovyc] ^
[groovyc] symbol: method parse(String,String,Logger)
[groovyc] location: class Main
[groovyc] 1 error
[groovyc] 1 error

/home/zaantar/prg/blogparser/groovy-blogparser/build.xml:74: Compilation Failed

Where "Main" is a groovy class and "parse" it's static method.

Here is my project (direct link to build.xml).

I will be grateful for any hint or help.


View this message in context: ANT problems in mixed Groovy/Java project
Sent from the groovy - user mailing list archive at
jim northrop | 20 Jul 08:43 2014

[groovy-user] groovy-core docs

Morning all -
working to add further docs to groovy-core DSL builders. so started to add more test code to hang my asciidoc include:: onto.

have a full download of groovy-core on my local system and can build/test groovy locally.

have added 2 test classes using swingbuiler and jsonbuilder. when running ./gradlew test
looks like i get missing/unknown classes as follows:

/Volumes/DURACELL/groovyCore/groovy-core/src/spec/test/SwingBuilderTest.groovy: 74: unable to resolve class SwingBuilder 
  <at> line 74, column 22.
           SwingBuilder swingbuilder = new SwingBuilder(null);

/Volumes/DURACELL/groovyCore/groovy-core/src/spec/test/SwingBuilderTest.groovy: 74: unable to resolve class SwingBuilder 
  <at> line 74, column 37.
           SwingBuilder swingbuilder = new SwingBuilder(null);

/Volumes/DURACELL/groovyCore/groovy-core/src/spec/test/JsonBuilderTest.groovy: 32: unable to resolve class JsonBuilder 
  <at> line 32, column 17.
       JsonBuilder jsonbuilder;

/Volumes/DURACELL/groovyCore/groovy-core/src/spec/test/JsonBuilderTest.groovy: 42: unable to resolve class JsonBuilder 
  <at> line 42, column 17.
       JsonBuilder jsonbuilder = null;

Have an import for both classes in code and also tried to test without imports but neither option let me get passed this failure. Am now thinking i need to tweek the gradle build script to see the SwingBuilder and JsonBuilder classes - but thats just a guess. Does the package name of the test class influence this ??? :-P

any suggestions ?

Paolo Di Tommaso | 20 Jul 00:29 2014

[groovy-user] Re: [gpars-user] Issue with CompileStatic and Gpars agent

Hi Bob, 

No, is not that. I think it is a <at> CompilerStatic related problem. 

I've opened an issue for it


On Fri, Jul 11, 2014 at 2:06 PM, Bob Brown <> wrote:
  def void foo() {

Looks a bit strange to me.

Try with only ONE of ‘void' OR ‘def'?


On 11 Jul 2014, at 21:57, Paolo Di Tommaso <paolo.ditommaso-Re5JQEeQqe8@public.gmane.orgm> wrote:

  def void foo() {

Bob Brown
Director, Transentia Pty. Ltd.
Training, consulting, development at the leading edge of technology.

    73 Frasers Rd. Mobile: 0416-078-813
    Ashgrove Email: bob <at>
    Brisbane Web:
    Queensland 4060

"We are all atheists about most of the gods that humanity has ever believed in.
 Some of us just go one god further."
  -- Richard Dawkins

NOTE: This email may NOT be taken to constitute an agreement to form a "prior relationship" or to give "prior affirmative consent" for the purposes of opt-in mass marketing.