首先,这个问题可能看起来很像: Play Framework: PersistenceException: The type is not an registered entity? (Ebean)但它不是......
我正在尝试保存一个实体,但它甚至不呈现模板,在我重新启动 Play 后它只会给出主题中的错误。当然,应用程序会编译。
我已经完成了在 Play 中使用 EBean 的所有步骤:
@Entity
带有(javax.persistence.Entity)的注释模型- 模型扩展模型 (
play.db.ebean.Model
) - 我的 Ebean 已启用
application.conf
ebean.default="models.*"
(我的课程在models
包中)
有什么建议么?我能做的测试?要检查的东西?公平地说,stackoverflow 是我最后的手段......
提前致谢,
完整的堆栈跟踪:
play.api.Configuration$$anon$1: Configuration error [Cannot register class [models.Producer] in Ebean server]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:71) ~[play_2.9.1.jar:2.0.2]
at play.api.Configuration.reportError(Configuration.scala:258) ~[play_2.9.1.jar:2.0.2]
at play.Configuration.reportError(Configuration.java:119) ~[play_2.9.1.jar:2.0.2]
at play.db.ebean.EbeanPlugin.onStart(EbeanPlugin.java:71) ~[play_2.9.1.jar:2.0.2]
at play.api.Play$$anonfun$start$1.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.2]
at play.api.Play$$anonfun$start$1.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.2]
Caused by: java.lang.ExceptionInInitializerError: null
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_02]
at java.lang.Class.forName(Class.java:264) ~[na:1.7.0_02]
at play.db.ebean.EbeanPlugin.onStart(EbeanPlugin.java:69) ~[play_2.9.1.jar:2.0.2]
at play.api.Play$$anonfun$start$1.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.2]
at play.api.Play$$anonfun$start$1.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.2]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library.jar:0.11.3]
Caused by: java.lang.RuntimeException: DataSource user is null?
at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.<init>(DataSourcePool.java:198) ~[ebean.jar:na]
at com.avaje.ebeaninternal.server.lib.sql.DataSourceManager.getDataSource(DataSourceManager.java:210) ~[ebean.jar:na]
at com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager.getDataSource(DataSourceGlobalManager.java:63) ~[ebean.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:427) ~[ebean.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:388) ~[ebean.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:168) ~[ebean.jar:na]