Exception in Grails when using HttpBuilder

Recently I encountered really nasty error in grails which took quite some time to fix. The problem manifested itself with MalformedParameterizedTypeException being thrown, but it was really hard to find reason because of the really weird stacktrace and it was only happening when being deployed on tomcat server. Exception looked something like this:

First it seem to have something to do with log4j system, but it turns out that HttpBuilder was to blame! It has different version of groovy specified as dependency, which was conflicting with version of groovy coming with grails, causing this nasty error.

To fix it, you need just exclude groovy dependency from HttpBuilder dependency, update your maven section of BuildConfig.groovy like this:

And it should work