1
我正在尝试集成Play Authenticate,同时仍在应用程序的其他任何位置使用JPA。在同一个Play Framework项目中同时使用Ebean和JPA
我:
ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:39)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:34)
while locating play.db.jpa.DefaultJPAApi$JPAApiProvider
while locating play.db.jpa.JPAApi
for parameter 2 at controllers.Persons.<init>(Persons.java:33)
while locating controllers.Persons
for parameter 5 at router.Routes.<init>(Routes.scala:48)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
while locating play.api.http.JavaCompatibleHttpRequestHandler
while locating play.api.http.HttpRequestHandler
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
at play.api.DefaultApplication.class(Application.scala:221)
while locating play.api.DefaultApplication
while locating play.api.Application
1 error
加入这行来build.sbt和plugins.sbt前:
excludeDependencies += "javax.persistence" % "persistence-api"
然而
,我需要为我的模型作为
[NullPointerException: null]
由@Entity注释触发。
我刚刚开始使用这个Play框架的Java,所以可能会出现我错过的东西。如有必要,请指出。
您在类路径(JPA 1?)中拥有JPA API jar的一个版本,并且您需要JPA API v2 +。因此,Play或EBean会对您施加一些依赖关系,以及您可以使用哪个JPA提供程序 –