Search code examples
grailsgrails-2.0xerces

Issue Deploying a Grails 2.1.1 app to JBoss because of Xerces


I have a Grails app that uses the Rest plugin

When I drop my war into my JBoss deploy directory and start it up, the deployment of the app fails because of the following error:

2012-11-01 15:48:33,931 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] XML error parsing: context.xml
org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser

I believe this refers to the grails app containing a version on xercesImpl as well as JBoss having it's own. We usually rectify this by removing xercesImpl from our apps or setting them to "provided" scope.

I'm trying to figure out how I fix this deploy issue. I'm assuming I have to edit the BuildConfig.groovy script and tell it, somehow, to exclude xerces right? How would I do that for this plugin? If this were a "dependency" that appears to be easy to specify the exclusions. But I'm not sure how to do it for this plugin...

any ideas?


Solution

  • It turns out, doing the following in the plugin section of my BuildConfig.groovy did the trick after all...

    compile(":rest:0.7"){
       excludes "xercesImpl"
    }