Geb NoClassDefFoundError: geb/error/UnableToLoadException
Geb NoClassDefFoundError: geb/error/UnableToLoadException
我一直在设置和测试 Geb 时遇到问题。
我有一个简单的 Groovy 脚本:
import geb.Browser;
println("Test 11")
Browser.drive {
go "http://www.google.com"
}
而且我总是收到以下错误:
Caught: java.lang.NoClassDefFoundError: geb/error/UnableToLoadException
java.lang.NoClassDefFoundError: geb/error/UnableToLoadException
at geb.Browser.<init>(Browser.groovy:61)
at geb.Browser.drive(Browser.groovy:1028)
at geb.Browser$drive.call(Unknown Source)
at Main.run(Main.groovy:8)
我写了一个 Class.forName("geb.error.UnableToLoadException")
将错误更改为
java.lang.NoClassDefFoundError: geb/error/GebException
at Main.run(Main.groovy:10)
Caused by: java.lang.ClassNotFoundException: geb.error.GebException
... 1 more
在我看来,Geb 正在搜索 class GebException
,这是 而不是 在我下载的 geb-core-2.1.jar
中!在这个罐子旁边,我还添加了 selenium-server-standalone-3.9.1.jar
。难道我做错了什么?我是否安装了错误的 geb-core 库?我正在使用 IntelliJ IDEA 作为 IDE。感谢您的帮助
此致
如果这是你的文件所在的 Maven 项目,我建议先检查 pom.xml 中的依赖项列表。
正如我在我的环境中测试的那样,它执行得很好
我一直在设置和测试 Geb 时遇到问题。 我有一个简单的 Groovy 脚本:
import geb.Browser;
println("Test 11")
Browser.drive {
go "http://www.google.com"
}
而且我总是收到以下错误:
Caught: java.lang.NoClassDefFoundError: geb/error/UnableToLoadException
java.lang.NoClassDefFoundError: geb/error/UnableToLoadException
at geb.Browser.<init>(Browser.groovy:61)
at geb.Browser.drive(Browser.groovy:1028)
at geb.Browser$drive.call(Unknown Source)
at Main.run(Main.groovy:8)
我写了一个 Class.forName("geb.error.UnableToLoadException")
将错误更改为
java.lang.NoClassDefFoundError: geb/error/GebException
at Main.run(Main.groovy:10)
Caused by: java.lang.ClassNotFoundException: geb.error.GebException
... 1 more
在我看来,Geb 正在搜索 class GebException
,这是 而不是 在我下载的 geb-core-2.1.jar
中!在这个罐子旁边,我还添加了 selenium-server-standalone-3.9.1.jar
。难道我做错了什么?我是否安装了错误的 geb-core 库?我正在使用 IntelliJ IDEA 作为 IDE。感谢您的帮助
此致
如果这是你的文件所在的 Maven 项目,我建议先检查 pom.xml 中的依赖项列表。
正如我在我的环境中测试的那样,它执行得很好