title: MySQL PersistenceException, "Connection is closed" in Play! 2.2
body: <p>I'm trying out Play framework and using 2.2.0 version and Java version.</p>
  
  <p>I want to use MySQL as the database, and I've followed the instruction at the site. I am able to get evolution script running, but I can't save anything to the database. The table created in the database. I got <code>[PersistenceException: java.sql.SQLException: Connection is closed!]</code> when trying to call Ebean.save() method, which is in my controller.</p>
  
  <p>What I've done is:</p>
  
  <ol>
  <li><p>Set up build.sbt and added the plugin</p>
  
  <pre><code>libraryDependencies ++= Seq(
      javaJdbc,
      javaEbean,
      cache,
      "mysql" % "mysql-connector-java" % "5.1.18"
  )
  </code></pre></li>
  <li><p>Set up conf/application.conf</p>
  
  <pre><code>db.default.driver=com.mysql.jdbc.Driver
  db.default.url="jdbc:mysql://localhost:3306/TLC?characterEncoding=UTF-8"
  db.default.user=root
  db.default.pass=secret
  </code></pre></li>
  <li><p>Ebean server</p>
  
  <pre><code>ebean.default="models.*"
  </code></pre></li>
  <li><p>Created controller class 
      package controllers;</p>
  
  <pre><code>import com.avaje.ebean.Ebean;
  import play.*;
  import play.data.Form;
  import play.mvc.*;
  import models.Bar;
  import views.html.*;
  
  public class Application extends Controller {
  
      public static Result index() {
          return ok(index.render("Your new application is ready."));
      }
  
      public static Result addBar() {
          Bar bar = Form.form(Bar.class).bindFromRequest().get();
          bar.save();
          return redirect(routes.Application.index());
      }
  }
  </code></pre></li>
  <li><p>Created a form</p>
  
  <pre><code>&lt;form action="@routes.Application.addBar()" method="post"&gt;
      &lt;input name="name"/&gt;
      &lt;input type="submit"/&gt;
  &lt;/form&gt;
  </code></pre></li>
  <li><p>Added the route</p>
  
  <pre><code>POST    /bars                       controllers.Application.addBar()
  </code></pre></li>
  <li><p>The model itself of course.
      package models;</p>
  
  <pre><code>import play.db.ebean.Model;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  @Entity
  public class Bar extends Model {
      @Id
      public String id;
      public String name;
  
  }
  </code></pre></li>
  <li><p>And of course creating the database itself in mysql.</p></li>
  </ol>
  
  <p>What did I miss? I've been on this like 4 hours and still have no idea what's wrong. If I used h2 in memory database, it works just fine. Please help me.</p>
  
  <p>Thanks!</p>