title: Play framework 2.1.x and EbeanServer
body: <p>I am struggling with running my first Play! 2.1.x app and I always get this error (this is from running the <code>test</code> cases) :</p>
  <blockquote>
  <p>Test models.TestModel.testCreate failed: The default EbeanServer has not been defined? This is normally set via the ebean.datasource.default property. Otherwise it should be registered programatically via registerServer()</p>
  </blockquote>
  <p>I have read the official manual, many SO questions, and even some blogs and I still can't figure out why I keep on getting this.</p>
  <p><strong>Note:</strong> I specify the <code>test.conf</code> file from <a href="https://stackoverflow.com/questions/14724788/playframework-settings-depending-on-environment">this SO question</a>, in <code>Build.scala</code>.</p>
  <p>Here is the content of <code>test.conf</code> :</p>
  <pre><code>include &quot;application.conf&quot;
  
  application.version=${application.major}.${application.minor}.${application.revision}-TEST
  
  db.default.driver=org.h2.Driver
  db.default.jndiName=DefaultDS
  db.default.url=&quot;jdbc:h2:mem:play;MODE=PostgreSQL;DB_CLOSE_DELAY=-1&quot;
  db.default.user=sa
  db.default.password=&quot;&quot;
  
  ebean.default=&quot;models.*&quot;
  ebean.datasource.factory=jndi
  ebean.datasource.default=DefaultDS
  </code></pre>
  <p><strong>Note:</strong> the same keys are also specified in <code>application.conf</code>, but with the &quot;prod&quot; values.</p>
  <p>What am I missing?
  Thanks!</p>
  <h3>** EDIT **</h3>
  <p>The test case is very straight forward. I am using a base class, copy-pasted as-is from <a href="http://blog.matthieuguillermin.fr/2012/03/unit-testing-tricks-for-play-2-0-and-ebean/" rel="nofollow noreferrer">this blog</a> :</p>
  <pre><code>public class TestSomeModel extends BaseModelTest {
      @Test
      public void myModelCreate() {
          SomeModel model = new SomeModel();
          model.someStringAttribute = &quot;some value&quot;;
      
          assertThat(model.id).isNull();
      
          model.save();  // &lt;--- this is the line that gives the error
          
          assertThat(model.id).isPositive();
      }
  }
  </code></pre>
  <p>... and if anyone insist on seeing the model class....</p>
  <pre><code>@Entity
  public class SomeModel extends Model {
      @Id
      public Long id;
  
      public String someStringAttribute;
  }
  </code></pre>