GRAILS-10336: Convert exception class to Java because of GROOVY-6080 bug