snovgorodsky | 23 Jul 00:27 2014
Picon

[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?

Thanks,
Sergey

--
View this message in context: http://groovy.329449.n5.nabble.com/Problem-running-execute-on-string-with-a-backslash-tp5720500.html
Sent from the groovy - user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 22 Jul 17:56 2014
Picon

[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

Hi, 

I need to generate a tree structure from a list of java packages, which I
read from a database. I am inspired by
https://gist.github.com/kiy0taka/2478499.

This works great:

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

        nSpacesTree.foo.bar.aa = 1
        nSpacesTree.foo.bar.bb = 1

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

The best I can do so far is:

        Eval.x(nSpacesTree, "x.foo.bar.qqq = 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: http://groovy.329449.n5.nabble.com/trees-groovy-golf-tp5720480.html
Sent from the groovy - user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email

Behrang Saeedzadeh | 22 Jul 02:35 2014
Picon

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

Hi,

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 = "https://test.com"
 user {
   admin {
                username = "test-admin"
                password = "test-pass"
            }
 }
}
    }

    // a bunch of other environments
    
}

Best regards,
Behrang
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.

Thanks

--
View this message in context: http://groovy.329449.n5.nabble.com/Disable-cookie-warnings-from-RESTClient-tp5720477.html
Sent from the groovy - user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email

Robert Rodini | 21 Jul 17:32 2014
Picon

[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 Dominant.java
-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 MainClass.java
-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 MainClass.java 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' MainClass.java
./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'
MainClass.java:8: 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
Picon

[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.
--

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

[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(GeneratedMetaMethod.java:78) 
        - waiting to lock <0x0000000600457e98> (a org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy) 
        at org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.isValidMethod(GeneratedMetaMethod.java:65) 
        at groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:2818) 
        at groovy.lang.MetaClassImpl.chooseMethod(MetaClassImpl.java:2810) 
        at groovy.lang.MetaClassImpl.getMethodWithoutCaching(MetaClassImpl.java:1290) 
        at groovy.lang.MetaClassImpl.pickMethod(MetaClassImpl.java:3359) 
        at groovy.lang.MetaClassImpl.findOwnMethod(MetaClassImpl.java:3300) 
        at groovy.lang.MetaClassImpl.searchInterfacesForMetaMethod(MetaClassImpl.java:3290) 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy(MetaClassImpl.java:3203) 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy(MetaClassImpl.java:3192) 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy(MetaClassImpl.java:3192) 
        at groovy.lang.MetaClassImpl.findMethodInClassHierarchy(MetaClassImpl.java:3192) 
        at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:825) 
        at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1131) 
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1084) 
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106) 
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906) 
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39) 
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) 
        at java_lang_String$indexOf.call(Unknown Source) 
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:82) 
        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
Picon

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

Hello,
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
init:
[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
build:
[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/MainWindow.java:179: 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]
[groovyc]
[groovyc] 1 error

BUILD FAILED
/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 https://github.com/zaantar/blogparser (direct link to build.xml).

I will be grateful for any hint or help.

Jan


View this message in context: ANT problems in mixed Groovy/Java project
Sent from the groovy - user mailing list archive at Nabble.com.
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 ?
thx
jim


Paolo Di Tommaso | 20 Jul 00:29 2014
Picon

[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



Best,
Paolo



On Fri, Jul 11, 2014 at 2:06 PM, Bob Brown <bob-KiwF19kzwtgVDcw6SFq9D4dd74u8MsAO@public.gmane.org> wrote:
“””
  def void foo() {
“””

Looks a bit strange to me.

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

BOB

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> transentia.com.au
    Brisbane Web: www.transentia.com.au
    Queensland 4060
    Australia

---
"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.



Gmane