I am developing a new system using postgreSQL with Ebean within play framework 2.2.1. They are all defined as Single table with a String discriminatory column. When I start the server it compiles but then I get this not very informative stacktrace when I call the localhost:9000
play.api.UnexpectedException: Unexpected exception[NullPointerException: null]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:148) ~[play_2.10-2.2.1.jar:2.2.1]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:112) ~[play_2.10-2.2.1.jar:2.2.1]
at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:112) ~[play_2.10-2.2.1.jar:2.2.1]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:110) ~[play_2.10-2.2.1.jar:2.2.1]
at scala.util.Success.flatMap(Try.scala:200) ~[scala-library.jar:na]
Caused by: java.lang.NullPointerException: null
at com.avaje.ebeaninternal.server.deploy.parse.DeployInherit.buildDeployTree(DeployInherit.java:70) ~[avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.deploy.parse.DeployInherit.initialise(DeployInherit.java:47) ~[avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.deploy.parse.DeployInherit.<init>(DeployInherit.java:35) ~[avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:108) ~[avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:204) ~[avaje-ebeanorm-3.2.2.jar:na]
at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:65) ~[avaje-ebeanorm-3.2.2.jar:na]
Here is an example of such relationship:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING)
@Table(name = "Accounts")
public abstract class Account extends Model {
}
@Entity
@DiscriminatorValue("companyaccount")
public class CompanyAccount extends Account {
}
@Entity
@DiscriminatorValue("personalaccount")
public class PersonalAccount extends Account {
}
From what I can read it seems to be something when Ebean is trying to generate SQL files about the @Inheritance(~)
relationship. It seems to have problem mapping it.
Anyone has had similar problems? Where should I start looking?