title: Java Play 2.3.8: DataSource user is null? bindFromRequest() does not work properly
body: <p>I started learning Play this week. Now I am trying to write a Code that creates a session, when a user logs in.
  Sorry, but the post looks a bit messy because I am new user, who is not allowed to post pictures. </p>
  
  <p>I am using Java play 2.3.8 and eclipse 4.4.1 (and I already tried the other tips i saw here)</p>
  
  <p>At the moment I always get this errormessage:</p>
  
  <blockquote>
    <p>play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.reflect.InvocationTargetException]]
        at play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.6.jar:2.3.6]
        at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.6.jar:2.3.6]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.6.jar:2.3.6]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.6.jar:2.3.6]
        at scala.Option.map(Option.scala:145) [scala-library-2.11.1.jar:na]
    Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at play.data.Form.bind(Form.java:394) ~[play-java_2.11-2.3.6.jar:2.3.6]
        at play.data.Form.bindFromRequest(Form.java:221) ~[play-java_2.11-2.3.6.jar:2.3.6]
        at controllers.Application.authenticate(Application.java:70) ~[classes/:na]
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$11$$anonfun$apply$11.apply(routes_routing.scala:209) ~[classes/:na]
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$11$$anonfun$apply$11.apply(routes_routing.scala:209) ~[classes/:na]
    Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_31]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_31]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_31]
        at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_31]
        at play.data.Form.bind(Form.java:391) ~[play-java_2.11-2.3.6.jar:2.3.6]
    Caused by: java.lang.RuntimeException: DataSource user is null?
        at com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.(DataSourcePool.java:204) ~[avaje-ebeanorm-3.3.4.jar:na]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.getDataSourceFromConfig(DefaultServerFactory.java:419) ~[avaje-ebeanorm-3.3.4.jar:na]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.setDataSource(DefaultServerFactory.java:385) ~[avaje-ebeanorm-3.3.4.jar:na]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:163) ~[avaje-ebeanorm-3.3.4.jar:na]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:125) ~[avaje-ebeanorm-3.3.4.jar:na]</p>
  </blockquote>
  
  <p>This is my method, that is called:</p>
  
  <pre><code>public static Result authenticate() {
  
      Form&lt;Login&gt; loginForm = Form.form(Login.class);
  
      Login loginUser = loginForm.bindFromRequest().get();
  
  
      if (!usersList.getUsers().contains(loginForm)) {
          return ok(login.render("test"));
      } else {
          session().clear();
          session("email", loginForm.get().email);
          System.out.println("ich bin hier");
          return redirect(routes.Application.login());
  
      }
  
  
  }
  </code></pre>
  
  <p>This is the model (getters and setters are there, too):</p>
  
  <pre><code>public class Login {
  
  public Login(){
  
  }
  public String email;
  public String password;
  
  public Login(String email, String password){
      this.email=email;
      this.password=password;
  }
  
  public String validate() {
      if (Users.authenticate(email, password) == null) {
        return "Invalid user or password";
      }
      return null;
  }
  
  public static Finder&lt;String,Login&gt; find = new Finder&lt;String,Login&gt;(
          String.class, Login.class
      ); 
  </code></pre>
  
  <p>And here the scala.html document:</p>
  
  <pre><code>&lt;div class="Login"&gt;
     &lt;br&gt;
      &lt;br&gt;
       &lt;br&gt;
        &lt;br&gt;
  
        &lt;h1&gt;Login&lt;/h1&gt;
  
  &lt;form action="@routes.Application.authenticate()" method="post"&gt;
   &lt;p&gt;&lt;input type="email" name="email" placeholder="Email" value=""&gt;&lt;/p&gt;
   &lt;p&gt;&lt;input type="password" name="password" placeholder="Password" value=""&gt;&lt;/p&gt;
   &lt;p class="submit"&gt;&lt;input type="submit" name="Login" value="Login"&gt;&lt;/p&gt;
  &lt;/form&gt;   
  </code></pre>
  
  <p></p>
  
  <p>And last but not least the error message in my browser says the exception is thrown in line 70:</p>
  
  <blockquote>
    <p>[RuntimeException: java.lang.reflect.InvocationTargetException]</p>
    
    <p>System.out.println("nach loginform");
    68
    69      //System.out.println(loginForm.bindFromRequest().toString());
    70      Login loginUser = loginForm.bindFromRequest().get();
    71
    72      System.out.println(loginForm.toString());
    73//        Form loginForm = form(Login.class).bindFromRequest();
    74<br>
    75      if (!usersList.getUsers().contains(loginForm)) {</p>
  </blockquote>
  
  <p>thanks in advance for helping me with this issue</p>