我正在使用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文件。
我该怎么做?
My Suite维基页面如下所示:
!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 |
答案 0 :(得分:0)
Maven是本地依赖存储库,但它与类路径无关。
在运行时类路径中找不到类org.apache.http.HttpEntity
。 您需要在运行时类路径上添加包含该类的库。