title: Play Framework: 2.0.2 PersistenceException:Cannot register class in Ebean server
body: <p>First of all, this question may seem much alike:
  <a href="https://stackoverflow.com/questions/9824190/play-framework-persistenceexception-the-type-is-not-a-registered-entity-ebea">Play Framework: PersistenceException: The type is not a registered entity? (Ebean)</a> but it's not...</p>
  
  <p>I'm trying to save an entity but it doesn't even render the template, after I restart Play it just gives the error in the subject.
  Of course, the app compiles.</p>
  
  <p>I've done all the steps to use EBean with Play:</p>
  
  <ul>
  <li>annotated model with <code>@Entity</code> (javax.persistence.Entity)</li>
  <li>model extends Model (<code>play.db.ebean.Model</code>)</li>
  <li>Ebean is enable in my <code>application.conf</code> <code>ebean.default="models.*"</code> (my classes are in the <code>models</code> package)</li>
  </ul>
  
  <p>Any suggestions? Tests I can do? Things to check?
  To be fair, stackoverflow is my last resort...</p>
  
  <p>Thanks in advance,</p>
  
  <p>Complete stack trace:</p>
  
  <pre><code>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.&lt;init&gt;(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]
  </code></pre>