gpt4 book ai didi

java.lang.NoClassDefFoundError : io/restassured/internal/common/assertion/AssertParameter

转载 作者:行者123 更新时间:2023-12-01 19:32:16 25 4
gpt4 key购买 nike

我有一个 Java 项目,我只需要使用 json-path 库,因此我从 https://repo1.maven.org/maven2/io/rest-assured/json-path/4.1.2/ 下载了它 json-path-4.1.0.jar 。我将它放在同一个 Eclipse 项目中的一个文件夹下,例如 test

我在eclipse中进入项目,右键单击它,然后构建路径 -> 配置构建路径 -> -> 添加 Jar 并从上面的 test 文件夹中选择 json-path jar,然后单击应用并关闭。构建项目并运行使用 json-path 库的类文件,但会导致错误 -

FAILED: test
java.lang.NoClassDefFoundError: io/restassured/internal/common/assertion/AssertParameter
at io.restassured.path.json.JsonPath.createJsonAssertion(JsonPath.java:1014)
at io.restassured.path.json.JsonPath.get(JsonPath.java:201)
at io.restassured.path.json.JsonPath.getString(JsonPath.java:352)
at com.eqtechnologic.framework.TestJsonPath.test(TestJsonPath.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Caused by: java.lang.ClassNotFoundException: io.restassured.internal.common.assertion.AssertParameter
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 28 more

有人可以帮忙解决这个问题吗?我重新启动了 Eclipse,多次重建项目,但没有成功。

最佳答案

在你的情况下至少rest-assured-common-4.1.0.jar需要修复 NoClassDefFoundError

参见JSON Path » 4.1.0编译依赖项部分。

关于java.lang.NoClassDefFoundError : io/restassured/internal/common/assertion/AssertParameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59249709/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com