I’ve run into this one a few times on Grails 1.3.x, and every time I have to go googling to sort it out - it’s time to write it down to speed up my Google searches!
The error I end up with is typically something like:
java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name “org/xml/sax/SAXParseException”
If you get this on a project after installing a new Grails plugin, this is probably some xml-api clash that the plugin has introduced. The workaround is nicely documented here. Just a matter of excluding xml-api in your BuildConfig and you’re away.
But what if you get this error when running a “grails create-app”? It’s too early to exclude anything - you haven’t even created the project!
To save you reinstalling your JDK/Grails/Groovy distros, it’s time to just blow away your IVY cache - (%USERPROFILE%/.ivy2/cache on Windows) and move on with your life! There’s a nice discussion on the Grails list about tracking down the offending jars using the JAVA_OPS=-verbose option and seeing exactly what is loading those XML classes!
Just wanted to write this down so I can find it later.