首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Geb - IncompatibleClassChangeError

Geb - IncompatibleClassChangeError
EN

Stack Overflow用户
提问于 2011-10-20 03:27:16
回答 2查看 3.7K关注 0票数 3

我刚开始使用Geb,在从Geb书中输入示例代码时遇到了这个错误:

代码语言:javascript
复制
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's javascript to redirect to Wikipedia
    waitFor { title == "Wikipedia" }
}

我遇到了这样的异常:

代码语言:javascript
复制
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)
        .......

有什么想法吗?谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-10-20 04:32:55

您是否碰巧在使用Java7?使用< Java 7编译的异常的Groovy代码与Java 7不兼容。

票数 12
EN

Stack Overflow用户

发布于 2013-02-12 21:50:12

从0.7.1开始,Geb与Java7兼容。如果你在下面,你应该升级。SEe:http://jira.codehaus.org/browse/GEB-194

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7826967

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档