0

In one of my application i have to use geb with grails. i installed geb plugin and added dependency selenium standalone jar.

Now the problem is while i cleaning or compiling i got the error like following

Interactive mode exited with error: loader constraint violation: when resolving overridden method "org.apache.xerces.jaxp.SAXParserImpl.getXMLReader()Lorg/xml/sax/XMLReader;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/apache/xerces/jaxp/SAXParserImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type org/xml/sax/XMLReader used in the signature (Use --stacktrace to see the full trace)

Vivek Kumar Ray
  • 8,323
  • 5
  • 21
  • 28
SivaPhani
  • 81
  • 9

1 Answers1

2

Exclude the transitive dependency of Selenium to xml-apis like this in your BuildConfig.groovy:

dependencies {
    test("org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion") {
        exclude "xml-apis"
    }
    test "org.codehaus.geb:geb-spock:$gebVersion"
    test "org.codehaus.geb:geb-junit4:$gebVersion"
}

See this example project for more details.

stefanglase
  • 10,296
  • 4
  • 32
  • 42