Play framework + Java +Ebean models.Donation is NOT an Entity Bean registered with this server?

32 Views Asked by At

I am usingPlay Framework 3, with Java , Ebean. I am trying to use models using ebean, but I am getting the following error everytime:

[PersistenceException: models.Donation is NOT an Entity Bean registered with this server?]

Here is my model:

package models;

import java.util.*;
import io.ebean.*;
import play.data.format.*;
import play.data.validation.*;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "donation")
public class Donation extends Model{
    @Id
    public Integer id;
    public String title;
    public String type;
    public Integer status;
    public static Finder<Integer, Donation> find = new Finder<>(Donation.class);
}

application.conf

db{
    default.driver="com.mysql.jdbc.Driver"
    default.url="jdbc:mysql://localhost/food"
    default.username=root
    default.password=""
    default.logSql=true

}
db.default.jndiName=DefaultDS
ebean.default = ["models.*"]

build.sbt

name := """play-java-seed"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava,PlayEbean)

scalaVersion := "2.13.12"

libraryDependencies ++= Seq(
  guice,
  "org.hibernate" % "hibernate-entitymanager" % "4.3.4.Final",
  "com.mysql" % "mysql-connector-j" % "8.2.0",
  evolutions,
  jdbc,
  javaJdbc
)

There is no documentation for ebean for play framework 3.0, Every time i make a request I get the same error saying the model is not an entity bean registered with the server.

0

There are 0 best solutions below