daniel.stastny | 20 Apr 20:28 2015
Picon

[groovy-user] How to write a web request with SSL certificate in Groovy wslite?

I would like to send a request with Groovy wslite using SSL certificate,
behind a proxy.

I am still getting error regarding the certificate (despite this certificate
should work in one module that is used for requests.

/import groovy.xml.*
import wslite.soap.*
import wslite.http.auth.*

def proxy = new Proxy(Proxy.Type.HTTP, new
InetSocketAddress('proxycust.custdomain.com', 8080))
def endpoint = "https://api1.multiinfo.customain.com/smsgw50.asmx"

def client = new SOAPClient(endpoint)

client.httpClient.sslTrustStoreFile = "C:/temp/serverKeyStore.jks"
client.httpClient.sslTrustStorePassword = "secretpass"
client.httpClient.sslTrustAllCerts = true

client.httpClient.proxy = proxy

def response = client.send(headers:["Content-Type":"text/xml;
charset=utf-8", "Content-Length":""],
                       connectTimeout:27000,
                       readTimeout:29000,
                       request)
/
Can you point me where can be the problem? What is necessary to care about
in wslite?
(Continue reading)

antoaravinth | 20 Apr 16:17 2015
Picon

[groovy-user] groovy.lang.GroovyRuntimeException: Unable to load logging class

I have this code:

 <at> groovy.util.logging.Slf4j 
class TestLog {
  def bar () {
    int count=0
    if( log.isTraceEnabled() )  {
        log.trace "${count++}"
    }
    return count
  }

  def foo () {
    int count=0
    log.trace "${count++}"
    return count
  }

}

when I try to run I get:

groovy.lang.GroovyRuntimeException: Unable to load logging class
	at
org.codehaus.groovy.transform.LogASTTransformation$AbstractLoggingStrategy.classNode(LogASTTransformation.java:270)
	at
groovy.util.logging.Slf4j$Slf4jLoggingStrategy.addLoggerFieldToClass(Slf4j.java:77)
	at
org.codehaus.groovy.transform.LogASTTransformation$1.visitClass(LogASTTransformation.java:113)
	at
(Continue reading)

Bahman Movaqar | 18 Apr 08:56 2015

[groovy-user] Looking for a clean way to write if-else

The if-else statement in Groovy doesn't return a value.
Consider the following example:

    def x = 10
    def y = if (x > 10) 'BIG' else 'SMALL'

This obviously fails in Groovy. For simple/short conditionals, it's not
big deal. For bigger & more complicated cases, the only solution I've
come to is as following:

    def result
    if (...) { ... }
    else if (...) { ... }
    else { ... }

This works. However, it's truly annoying to see a variable defined
without any specific value and then mutated in one of several
conditional paths. I could do this as well:

    def result = [] // assuming the 'else' branch would return this
    if (...) { ... }
    else if (...) { ... }

But this is not beautiful as I'm dropping the 'else' part from a
condition statement.

Now, I'd like to ask other fellow Groovistas:
1. Are you aware of any cleaner solution?
2. Why does Groovy if-else statement doesn't return a value?

(Continue reading)

Pascal Schumacher | 17 Apr 16:58 2015
Picon
Picon

[groovy-user] Groovy Repository moved to Apache

Hello everybody,

the Groovy repository moved to Apache.

It's now mirrored on github under https://github.com/apache/incubator-groovy

Please send any pull requests to this new repository.

Thanks and kind regards,
Pascal

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

    http://xircles.codehaus.org/manage_email

Jamie Echlin | 16 Apr 11:37 2015
Picon

[groovy-user] Securing GStringTemplateEngine…

Morning,


I am using the excellent technique outlined by Cedric at http://melix.github.io/blog/2015/03/sandboxing.html, to sandbox and control user-supplied code.


I am also a user of GStringTemplateEngine, which I also need to secure in the same way. This is not as straightforward as it may seem. I have a few issues, please feel free to respond to any of them:


GStringTemplateEngine parses the code parts out of a template into a temporary class, which begins like: 


package groovy.tmp.templates

def getTemplate() { return { out -> out << "


The problem is that “out” is dynamically typed, which is not compatible with CompileStatic… CompileStatic is a requirement for the sandboxing, so that you can check the receiver classes.


Should I submit a PR to change it to “Writer out -> out <<...”? I think that is the correct type, seems to work anyway, although have not run the test suite.


The second thing that tripped me up is that, by default, it will create a new child classloader from the passed in one. The issue is that the child doesn’t have the compilation customisers like CompileStatic, so the sandboxing doesn’t happen. There is the option to use the provided classloader instead, but there is a comment: “Use a new class loader by default for each class so each class can be independently garbage collected”. 


I am wondering if anyone can tell me the downsides of not allowing the independent GC… I am not expecting hundreds of classes to be generated, but if I was I guess I could recycle the passed in classloader.


As always, thanks in advance.

cheers, jamie


Amy E. Brown | 15 Apr 17:02 2015
Picon

[groovy-user] Gvm install using MinGW on Windows, can't run groovy

Hi,

I am trying to get groovy 2.4.3 installed on a Win7 laptop with gvm via MinGW.

The necessary files appear to be present  in .gvm after the install, but when I try to run groovy in the bash shell I get "command not found."

If I run groovy -version from groovy/bin, I get "could not find or load main class org.codehaus groovy.tools.GroovyStarter".

The existence/nonexistence of GROOVY_HOME in my PATH makes no difference. Same result.

Did some googling, found nothing helpful.

Guillaume Laforge | 14 Apr 17:07 2015
Picon

[groovy-user] [ANN] Groovy Weekly #66

Hi all,

Here's Groovy Weekly #66, with lots of great content coming straight from the Greach conference:

Enjoy!

--
Guillaume Laforge
Groovy Project Manager
Product Ninja & Advocate at Restlet

[groovy-user] GR8Conf Europe

Hi Groovy developers,

I would like to let you know, that GR8Conf EarlyBird sales ends April 15. This is the last chance to get your discounted ticket.

GR8Conf is an independent, affordable series of conferences in Denmark and the US. It's dedicated to the technologies in the Groovy ecosystem.

We feed the brains of attendees with all the important stuff from the Groovy and Grails community.

We have in-depth talks covering all major technologies in the Groovy ecosystem. All talks are performed by the brightest minds and core developers in their fields.

Some of the technologies covered are Groovy, Grails, Gradle, Spock, Griffon and many many more.

We hope to see you in Copenhagen June 2-4.

Best regards,
Søren Berg Glasius
GR8Conf Europe organizing team

GR8Conf ApS
Mobile: (+1)510-984-8362, Web: www.gr8conf.eu, Skype: sbglasius 
Company Address: Buchwaldsgade 50, 5000 Odense C, Denmark
Personal Address: 2915 Shattuck Avenue, Berkeley, CA-94705, USA
--- GR8Conf - Focused on the Groovy Ecosystem
sterg | 2 Apr 12:27 2015
Picon

[groovy-user] Socket based interface instead of JNI for accessing native code

Hi all,

I tried a different approach of accessing the GNU Scientific Library (GSL)
from GroovyLab
https://sourceforge.net/projects/groovylab/files/

instead of the usual JNI based,
this approach is based on using sockets.

I implemented I sketch of a gslserver that offers currently
only the eigenvalue operation,
code is in gslserver.c that uploaded in page:

https://sourceforge.net/projects/groovylab/files/

This approach seems to work and with local sockets
gives performance better than JNI,
but perhaps because that I compiled the GSL code with the -Ofast
option,
and the JNI called GSL code is precompiled from the JavaCPP project.

This GroovyLab code works with local sockets (on Linux),
of course installing GSL, and compiling and running gslserver.c is required.


initLocalHostClient()

N=500
x = rand(N,N)

tic()
evals = gslServerEig(x.getArray())
tmGSLsocket = toc() //1.6 sec

tic()
evaljava = eig(x)
tmJava=toc()  // 1.92

tic()
evalGSLJNI =x.gsleig()
tmGSLJNI = toc()  // 1.72 sec



 ..  I would like further discussion from interested users ...


Best Regards
Stergios
Michael West | 1 Apr 16:36 2015

[groovy-user] how to get groovy version from within groovy code?

how can I discover what version of groovy I am using from within a script?

--
View this message in context: http://groovy.329449.n5.nabble.com/how-to-get-groovy-version-from-within-groovy-code-tp5723352.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

sebDK | 1 Apr 11:12 2015

[groovy-user] Problem % sign in my arguments

Hi there,

Here is my groovy script:

Here how I run the script:

Result: 

Why the percent signs are not shown?
How can I show the % sign?

Thanks for your help.

Sébastien

--
View this message in context: http://groovy.329449.n5.nabble.com/Problem-sign-in-my-arguments-tp5723349.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


Gmane