Tag Archives: groovy

Gradle groovy compile and out of memory error

Today was my first real day with Gradle.

I struggled for hours trying to get the groovy compile process to have enough memory to compile my code and not fall over with out of memory exceptions. This is what I would usually get.

Started Gradle compiler daemon with fork options DaemonForkOptions{minHeapSize=null, maxHeapSize=null, jvmArgs=[], classpath=[/Users/muz/.gvm/grails/1.3.9/lib/groovy-all-1.7.8.jar, /Users/muz/.gvm/gradle/1.8/lib/ant-1.9.2.jar, /Users/muz/.gvm/gradle/1.8/lib/ant-launcher-1.9.2.jar]}.

Executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler@e4865ce in compiler daemon.

Exception executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler@e4865ce in compiler daemon: java.lang.OutOfMemoryError: Java heap space.

Things that did not work

Continue reading

Groovy with Geb using Phantomjs and ssl certs

Here is my setup for using self signed certs and allowing the PhantomJsDriver to use Phantomjs and hit https pages while using self signed certificates.

Read Tomás Lin’s excellent post on setting up Geb with Phantomjs.

http://fbflex.wordpress.com/2013/03/18/how-to-configure-webdriver-in-grails-for-your-geb-tests/

The phantomjsdriver will producde a log file phantomjsdriver.log when creating the instance of phantomjs.

Negotiated Capabilities: {“browserName”:”phantomjs”,”version”:”1.9.1″,”driverName”:”ghostdriver”,”driverVersion”:”1.0.3″,”platform”:”mac-10.8 (Mountain Lion)-32bit”,”javascriptEnabled”:true,”takesScreenshot”:true,”handlesAlerts”:false,”databaseEnabled”:false,”locationContextEnabled”:false,”applicationCacheEnabled”:false,”browserConnectionEnabled”:false,”cssSelectorsEnabled”:true,”webStorageEnabled”:false,”rotatable”:false,“acceptSslCerts”:false,”nativeEvents”:true,”proxy”:{“proxyType”:”direct”}}

AcceptSslCerts is shown as false in the log, but the below code will use command line arguments to force phantomjs to accept any certificate.  The value we are most interested in is –ignore-ssl-errors=true

https://github.com/ariya/phantomjs/wiki/API-Reference

Continue reading