I have a Play 2.4.6 app that was working fine until two days ago. Since yesterday, I got this error:
[[37minfo] - application - Creating Pool for datasource 'default'
[[31merror] - com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager - Error in deployment
java.lang.IllegalStateException: Bean class models.User is not enhanced?
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.setEntityBeanClass(BeanDescriptorManager.java:1405) ~[avaje-ebeanorm-6.8.1.jar:na]
I already looked for solutions but I am still getting that error. Even, I tried using plugin 2.0
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "2.0.0")
How can I fix it?
Thank you in advance,
Update: In the end, I rewrote the code, removed EBean, and began to use Play Framework's database pool and JDBC's PreparedStatement
. Works fine. I will leave this question here, hoping it helps someone else.
答案 0 :(得分:2)
Check the following:
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
<description><![CDATA[]]></description>
<display-name></display-name>
<enterprise-beans>
<session id="">
<description><![CDATA[]]></description>
<ejb-name></ejb-name>
<env-entry>
<env-entry-name></env-entry-name>
<env-entry-type></env-entry-type>
<env-entry-value><![CDATA[]]></env-entry-value>
</env-entry>
ebean.default=["models.*"]
is in your plugin.sbt file.addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
答案 1 :(得分:1)
如果您想再次使用ebean进行尝试,这对我来说是个窍门
答案 2 :(得分:0)
如果您try all of the given solutions
和couldn't
解决了该问题,请检查项目的JDK版本。
Java11存在某种问题。 尝试Java8或更低版本。
答案 3 :(得分:0)
根据您使用的播放框架的版本,可能需要更改
ebean.default= ["models.*", "another.models.*"]
到
ebean.default="models.*, another.models.*"
您可以在此处找到更多详细信息: https://github.com/playframework/play-ebean/issues/18
此外,您将需要为每个需要eBean增强器的模块配置playEbeanModels。例如:
lazy val domainModel = (project in file("domain-model")).enablePlugins(PlayJava, PlayEbean).settings(Seq(
libraryDependencies ++= Seq(
"org.projectlombok" % "lombok" % "1.18.4",
"com.h2database" % "h2" % "1.4.197",
guice),
playEbeanModels in Compile := Seq("com.mycompany.model.*"), // this should match the package name from above ebean.default="com.mycompany.model.*
playEbeanDebugLevel := 4
)
在这里也可以找到一些解释: https://github.com/playframework/play-ebean/issues/25