Can't find a solution?

Post questions to the Ebean forum at: Ebean google group

java.lang.IllegalStateException: Bean class _ is not enhanced?


1. Check that the IDE enhancement plugin for IDEA or Eclipse is installed
2. Check that the enhancement plugin for maven or gradle is being used

See docs / getting started for more details on enhancement.

NullPointerException using Query beans


new QCustomer
  .name.istartsWith("rob")  //   <-- Getting NPE here


For Java: The query beans or the code using the query beans is not being enhanced.

For Kotlin: The query beans are not being enhanced.


1. Check the querybean-packages entry in

For Java: We need to enhance both the code that is using the query beans and the query beans themselves. The packages specified by querybean-packages needs to include the code that is using the query beans.

For Kotlin: For Kotlin we only need to enhance the query beans themselves (and not the calling code). For Kotlin the querybean-packages just needs to include the query beans.

Note that since 12.1.8 we no longer need to support query bean enhancement.

NullPointerException in EntityBeanIntercept


Caused by: java.lang.NullPointerException: null
at io.ebean.bean.EntityBeanIntercept.isLoadedProperty(
at io.ebean.bean.EntityBeanIntercept.preGetter(
at models.Security._ebean_get_status(


For Java:There is probably a @OnetoMany or a @ManyToOne mapping that is faulty.

For Kotlin:There is probably a @OnetoMany or a @ManyToOne mapping that is faulty.


1. Check the mappings in the model class that is throwing the exception.
In our example above, it is the models.Security class. Comment out each mapping until the exception goes away, then you have identified the problem.


RuntimeException: Is class org.example.domain.Foo registered?


Ebean does not think the bean in question is an entity bean, or we are explicitly registering entity beans (via ServerConfig.addClass()) and have not added the entity bean to that.


1. Check that the bean has @Entity annotation
2. Register the entity bean if necessary

If the entity beans are being explicit registered via serverConfig.addClass() then it could be that this entity bean class needs to also be included.

Typically stacktrace
Caused by: java.lang.RuntimeException: Error with association to [class org.example.domain.Contact]
 from [org.example.domain.Customer.contacts]. Is class org.example.domain.Contact registered?
 at io.ebeaninternal.server.deploy.parse.AnnotationAssocManys.readToOne(
 at io.ebeaninternal.server.deploy.parse.AnnotationAssocManys.parse(
 at io.ebeaninternal.server.deploy.parse.ReadAnnotations.readAssociations(
 ... 37 more


DataSource user is null?


1. Check that there is a application-test.yml (or equivalent) to specify the datasource
2. Check that io.ebean : ebean-test is a test dependency

See docs / testing for setting up ebean-test

Typically stacktrace
ERROR io.ebean.Ebean - Error trying to create the default EbeanServer
 java.lang.RuntimeException: DataSource user is null?
 at org.avaje.datasource.pool.ConnectionPool.&lt;init&gt;(
 at org.avaje.datasource.core.Factory.createPool(
 at io.ebeaninternal.server.core.DefaultContainer.getDataSourceFromConfig(
 at io.ebeaninternal.server.core.DefaultContainer.setDataSource(