Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Grails hip tip: LinkageError with SAXParseException

 

Recently a bogue error popped up with an existing Grails project at a client site. In an effort to abstract core domain logic (i.e. business rules) for a financial application, we decided to leverage Drools; consequently, after some prototyping of rules in a non-Grails project, we decided to start evaluating the Grails Drools plugin.

After installing said plugin, however, Grails failed to start up, instead issuing the error:

java.lang.LinkageError: loader constraint violation: loader (instance of ) previously initiated loading for a different type with name “org/xml/sax/SAXParseException”

followed by an equally nefarious stack trace.

It turns out that differing versions of the xml-apis jar will force this issue; accordingly, if this happens to you, you can fix the situation by simply locating the offending jar file (in this case, it was the Drools plugin which includes a differing version: xml-apis-1.0.b2.jar) and removing it.

Looking to spin up Continuous Integration quickly? Check out www.ciinabox.com.