gpt4 book ai didi

java - FitNesse 的 Maven 依赖项出现“NoClassDefFoundError”

转载 作者:太空宇宙 更新时间:2023-11-04 14:04:52 25 4
gpt4 key购买 nike

我正在使用 FitNesse Slim 执行一些简单的 POST/GET 请求。我使用 Maven 作为我的依赖管理系统。

当我尝试运行我的 Fixture 时收到以下错误消息。

__EXCEPTION__:java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_76]
at java.lang.Class.forName(Class.java:191) [rt.jar:1.7.0_76]
at fitnesse.slim.SlimExecutionContext.getClass(SlimExecutionContext.java:128) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.searchPathsForClass(SlimExecutionContext.java:118) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.createInstanceOfConstructor(SlimExecutionContext.java:89) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.create(SlimExecutionContext.java:43) [fitnesse-20150226.jar]
at fitnesse.slim.StatementExecutor.create(StatementExecutor.java:77) [fitnesse-20150226.jar]
at fitnesse.slim.instructions.MakeInstruction.executeInternal(MakeInstruction.java:26) [fitnesse-20150226.jar]
at fitnesse.slim.instructions.Instruction.execute(Instruction.java:30) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:49) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:43) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor.execute(ListExecutor.java:83) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:87) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:80) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:59) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.serve(SlimServer.java:45) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.handle(SlimService.java:184) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.acceptOne(SlimService.java:192) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.accept(SlimService.java:154) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.startWithFactory(SlimService.java:75) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.main(SlimService.java:56) [fitnesse-20150226.jar]
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [rt.jar:1.7.0_76]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [rt.jar:1.7.0_76]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_76]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [rt.jar:1.7.0_76]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [rt.jar:1.7.0_76]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) [rt.jar:1.7.0_76]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [rt.jar:1.7.0_76]
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_76]
at java.lang.Class.forName(Class.java:191) [rt.jar:1.7.0_76]
at fitnesse.slim.SlimExecutionContext.getClass(SlimExecutionContext.java:128) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.searchPathsForClass(SlimExecutionContext.java:118) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.createInstanceOfConstructor(SlimExecutionContext.java:89) [fitnesse-20150226.jar]
at fitnesse.slim.SlimExecutionContext.create(SlimExecutionContext.java:43) [fitnesse-20150226.jar]
at fitnesse.slim.StatementExecutor.create(StatementExecutor.java:77) [fitnesse-20150226.jar]
at fitnesse.slim.instructions.MakeInstruction.executeInternal(MakeInstruction.java:26) [fitnesse-20150226.jar]
at fitnesse.slim.instructions.Instruction.execute(Instruction.java:30) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:49) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:43) [fitnesse-20150226.jar]
at fitnesse.slim.ListExecutor.execute(ListExecutor.java:83) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:87) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:80) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:59) [fitnesse-20150226.jar]
at fitnesse.slim.SlimServer.serve(SlimServer.java:45) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.handle(SlimService.java:184) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.acceptOne(SlimService.java:192) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.accept(SlimService.java:154) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.startWithFactory(SlimService.java:75) [fitnesse-20150226.jar]
at fitnesse.slim.SlimService.main(SlimService.java:56) [fitnesse-20150226.jar]

我假设这是因为我没有正确设置 Maven 存储库,以便 FitNesse 可以找到 HttpEntity 类/jar 文件。

我该如何去做呢?

我的 Suite wiki 页面如下所示:

!define TEST_SYSTEM {slim}

!path target/classes
!path /home/foobar/.m2/repository

>FoobarFitnesse

我的测试页面如下所示:

|import  |
|mypackagename|


!|SimpleFoobarFixture |
|baseUrl |appId |utterance |commandName|
|abc.123.com|some-app-id|What is the weather in San Diego|Forecast |

最佳答案

Maven是本地依赖库,但与类路径无关。

在运行时类路径中找不到类org.apache.http.HttpEntity您需要在运行时类路径上添加包含该类的库。

关于java - FitNesse 的 Maven 依赖项出现“NoClassDefFoundError”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28971764/

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