title: InstantiationException for controllers in Play Framework after upgrading IntelliJ
body: <p>I keep getting an InstantiationException for my home controller with the following error:</p>
  
  <p>[InstantiationException: project.ui.controllers.HomeController]</p>
  
  <pre><code>case project_ui_controllers_HomeController_index37(params) =&gt; {
     call { 
          invokeHandler(play.api.Play.maybeApplication.map(_.global).getOrElse(play.api.DefaultGlobal).getControllerInstance(classOf[project.ui.controllers.HomeController]).index(), HandlerDef(this, "project.ui.controllers.HomeController", "index", Nil,"GET", """""", Routes.prefix + """"""))
     }
  }
  </code></pre>
  
  <p>Here is the log output:</p>
  
  <pre><code>play.api.Application$$anon$1: Execution exception[[InstantiationException:     project.ui.controllers.HomeController]]
  at play.api.Application$class.handleError(Application.scala:293) ~[play_2.10.jar:2.2.3]
  at play.api.DefaultApplication.handleError(Application.scala:399) [play_2.10.jar:2.2.3]
  at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:264) [play_2.10.jar:2.2.3]
  at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:264) [play_2.10.jar:2.2.3]
  at scala.Option.map(Option.scala:145) [scala-library.jar:na]
  at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:264) [play_2.10.jar:2.2.3]
  at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:260) [play_2.10.jar:2.2.3]
  at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library.jar:na]
  at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library.jar:na]
  at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library.jar:na]
  at play.api.libs.iteratee.Execution$$anon$1.execute(Execution.scala:43) [play-iteratees_2.10.jar:2.2.3]
  at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library.jar:na]
  at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) [scala-library.jar:na]
  at scala.concurrent.Promise$class.complete(Promise.scala:55) [scala-library.jar:na]
  at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) [scala-library.jar:na]
  at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) [scala-library.jar:na]
  at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) [scala-library.jar:na]
  at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library.jar:na]
  at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) [scala-library.jar:na]
  at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library.jar:na]
  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library.jar:na]
  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library.jar:na]
  at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library.jar:na]
  Caused by: java.lang.InstantiationException: project.ui.controllers.HomeController
  at java.lang.Class.newInstance(Class.java:359) ~[na:1.7.0_55]
  at play.api.GlobalSettings$class.getControllerInstance(GlobalSettings.scala:181) ~[play_2.10.jar:2.2.3]
  at play.api.DefaultGlobal$.getControllerInstance(GlobalSettings.scala:189) ~[play_2.10.jar:2.2.3]
  at Routes$$anonfun$routes$1$$anonfun$applyOrElse$38$$anonfun$apply$110.apply(routes_routing.scala:496) ~[na:na]
  at Routes$$anonfun$routes$1$$anonfun$applyOrElse$38$$anonfun$apply$110.apply(routes_routing.scala:496) ~[na:na]
  at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183) ~[play_2.10.jar:2.2.3]
  at play.core.Router$Routes$$anon$1.invocation(Router.scala:377) ~[play_2.10.jar:2.2.3]
  at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56) ~[play_2.10.jar:2.2.3]
  at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91) ~[play_2.10.jar:2.2.3]
  at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90) ~[play_2.10.jar:2.2.3]
  at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82) ~[play_2.10.jar:2.2.3]
  at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82) ~[play_2.10.jar:2.2.3]
  at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251) ~[scala-library.jar:na]
  at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) ~[scala-library.jar:na]
  at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library.jar:na]
  at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37) ~[play_2.10.jar:2.2.3]
  at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42) ~[akka-actor_2.10.jar:2.2.0]
  at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) ~[akka-actor_2.10.jar:2.2.0]
  ... 4 common frames omitted
  </code></pre>
  
  <p>I also find it interesting that i have no problem with this once i move the same code to production.</p>
  
  <p>The route in conf/routes</p>
  
  <pre><code>GET / @project.ui.controllers.HomeController.index()
  </code></pre>
  
  <p>Guice Injector Global.java:</p>
  
  <pre><code>public class Global extends GlobalSettings {
  
  private static final Injector INJECTOR = createInjector();
  
  @Override
  public void onStart(Application app) {
      super.onStart(app);
      new DatabaseSeeder().seed();
  }
  
  @Override
  public &lt;A&gt; A getControllerInstance(Class&lt;A&gt; controllerClass) throws Exception {
      return INJECTOR.getInstance(controllerClass);
  }
  
  private static Injector createInjector() {
      return Guice.createInjector(new BusinessLayerModule(), new DataLayerModule(), new UtilitiesModule());
  }
  }
  </code></pre>