Geb - IncompatibleClassChangeError

I am just starting with Geb and encountering this error when entering the example code from the Geb book:

import geb.Browser


Browser.drive {
    go "http://google.com/ncr"

    // make sure we actually got to the page
    assert title == "Google"

    // enter wikipedia into the search field
    $("input", name: "q").value("wikipedia")

    // wait for the change to results page to happen
    // (google updates the page dynamically without a new request)
    waitFor { title.endsWith("Google Search") }

    // is the first link to wikipedia?
    def firstLink = $("li.g", 0).find("a.l")
    assert firstLink.text() == "Wikipedia"

    // click the link
    firstLink.click()

    // wait for Google javascript to redirect to Wikipedia
    waitFor { title == "Wikipedia" }
}

I meet this exception:

Caught: java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
    at geb.error.GebException.<init>(GebException.groovy:20)
    at geb.waiting.WaitTimeoutException.<init>(WaitTimeoutException.groovy:30)
    at geb.waiting.Wait.waitFor(Wait.groovy:108)
        .......

Any ideas? Thank!

+3
source share
2 answers

Are you using Java 7 by accident? Groovy, which uses exceptions that have been compiled with <Java 7 is not compatible with Java 7.

+11
source

Geb is compatible with Java7 with 0.7.1. If you are below what you need to upgrade. SEe: http://jira.codehaus.org/browse/GEB-194

+1
source

All Articles