如何安装第一个 Ninja Web Framework 应用程序?
Posted
技术标签:
【中文标题】如何安装第一个 Ninja Web Framework 应用程序?【英文标题】:How to install the first Ninja Web Framework application? 【发布时间】:2014-12-05 23:54:01 【问题描述】:我正在尝试安装第一个出现在here 的 Ninja Web 框架应用程序,但我收到了失败的测试错误。我的java版本是
$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
我的 Maven 版本是
$ mvn3 -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 07:51:28-0600)
Maven home: /opt/local/share/java/maven3
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"
我在输入mvn3 clean install
后收到的错误是:
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 5.696 sec <<< FAILURE!
Results :
Tests in error:
testGetIndex(controllers.ApiControllerDocTesterTest): java.lang.NullPointerException: Ninja injector cannot be generated. Please check log for further errors.
testGetIndex(controllers.ApiControllerDocTesterTest)
testGetHelloWorldJson(controllers.ApiControllerDocTesterTest): java.lang.NullPointerException: Ninja injector cannot be generated. Please check log for further errors.
testGetHelloWorldJson(controllers.ApiControllerDocTesterTest)
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.261s
[INFO] Finished at: Fri Oct 10 13:22:47 CDT 2014
[INFO] Final Memory: 20M/125M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project ninja: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/gorayni/Development/ninja/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
关于什么是错误的以及如何解决它的任何想法?
【问题讨论】:
你看到这部分了吗Ninja injector 无法生成。请检查日志以了解更多错误?日志中有什么内容吗? 是的,日志中出现了Ninja注入器错误:Tests in error: testGetIndex(controllers.ApiControllerDocTesterTest): java.lang.NullPointerException: Ninja injector cannot be generated。请检查日志以了解更多错误。 testGetIndex(controllers.ApiControllerDocTesterTest) testGetHelloWorldJson(controllers.ApiControllerDocTesterTest): java.lang.NullPointerException: Ninja injector 无法生成。请检查日志以了解更多错误。 testGetHelloWorldJson(controllers.ApiControllerDocTesterTest) 你可以试试 Maven 3.1 吗?我认为 Maven 3.0 有一些问题... 【参考方案1】:应该可以正常工作。造成麻烦的一件事是 Maven 3.0。您可以尝试使用 Maven 3.1(或 3.2)吗?这应该可以解决它。
【讨论】:
以上是关于如何安装第一个 Ninja Web Framework 应用程序?的主要内容,如果未能解决你的问题,请参考以下文章