Wednesday, April 8, 2015

Configuring GIT in Eclipse

Monday, March 30, 2015

Grails dumping SQL statements

Edit the DataSource.groovy


dataSource {
   dbCreate = ...
   url = ...
   ...
   logSql = true
}

And in the Config.groovy:


log4j = {
   ...
   debug 'org.hibernate.SQL'
   trace 'org.hibernate.type'
}

Wednesday, March 25, 2015

Grails JSON encoding applyCodec

I had some data that I wanted to render in the GSP page, however, by default single quotes were being encoded as

"


To prevent grails from encoding your output, wrap it in the undocumented  applyCodec tag as follows:


var selectedItems = <g:applyCodec encodeAs="none">${data as grails.converters.JSON}</g:applyCodec>

Reference:


http://aruizca.com/how-to-render-json-properly-without-escaping-quotes-inside-a-gsp-script-tag/

Monday, March 9, 2015

Starting elasticsearch "Too small initial heap for new size specified"

When starting elasticserach for the first time I received the following error:


Error occurred during initialization of VM
Too small initial heap for new size specified


Added the following to elasticsearch.bat


set JAVA_OPTS=-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=1024m -XX:MaxNewSize=1024m -XX:PermSize=768m -XX:MaxPermSize=768m -XX:+DisableExplicitGC