我把头撞在墙上(几乎是字面意思),想弄清楚我为什么会这样
NullPointException
17天
(现在你相信了,不是吗?)。
所以,阅读和阅读Play的文档时,我注意到了一些东西(我不知道以前怎么没有注意到!)。
配置Ebean
Ebean ORM带来了游戏。要启用它,请将Play Ebean插件添加到project/plugins.SBT中的SBT插件:
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.0")
此外,在以下网址阅读一些帖子:
Play's forum
,我注意到了那个版本
2.5.6
发布了,我正在使用版本
2.5.4
,无论如何,我都升级了它,并且它工作了,它解决了我的
NullPointerException
问题
然而,我通过Play的模板创建了一个新项目:
activator new
Fetching the latest list of templates...
Browse the list of templates: http://lightbend.com/activator/templates
Choose from these featured templates or enter a template name:
1) minimal-akka-java-seed
2) minimal-akka-scala-seed
3) minimal-java
4) minimal-scala
5) play-java
6) play-scala
(hit tab to see a list of all templates)
> 5
Enter a name for your application (just press enter for 'play-java')
> a-new-project
OK, application "a-new-project" is being created using the "play-java" template.
To run "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator run
To run the test for "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator test
To run the Activator UI for "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator ui
然后检查
project/plugins.sbt
文件:
// Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using
// enablePlugins(PlayEbean).
// addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")
这就引出了我的问题:如果你要通过play的项目模板开始一个新项目,为什么要从最旧版本的插件开始?最好从这些插件的最新版本开始?
您可以在我的存储库中看到我的更改
here
.