title: ProvisionException: Unable to provision, in play framework
body: <p>I am getting these error 
  ProvisionException: Unable to provision, see the following errors:</p>
  
  <pre><code>com.google.inject.ProvisionException: Unable to provision, see the following errors:
  
  1) Could not find a suitable constructor in models.factory.FactoryHandler. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
    at models.factory.FactoryHandler.class(FactoryHandler.scala:7)
    while locating models.factory.FactoryHandler
      for parameter 0 at controllers.DirectUserController.&lt;init&gt;(DirectUserController.scala:90)
    while locating controllers.DirectUserController
      for parameter 7 at router.Routes.&lt;init&gt;(Routes.scala:124)
    while locating router.Routes
    while locating play.api.inject.RoutesProvider
    while locating play.api.routing.Router
  
  1 error
       com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
       com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
       play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
       play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
       play.api.Application$class.routes(Application.scala:111)
       play.api.DefaultApplication.routes(Application.scala:240)
       play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:90)
       play.api.Play$$anonfun$start$1.apply(Play.scala:87)
       play.api.Play$$anonfun$start$1.apply(Play.scala:87)
       play.utils.Threads$.withContextClassLoader(Threads.scala:21)
       play.api.Play$.start(Play.scala:87)
  </code></pre>
  
  <p>here is the code</p>
  
  <pre><code>class FactoryHandler(var s:String="real") {
    val log = LoggerFactory.getLogger(this.getClass)
    log.debug("choice {}",s)
  }
  </code></pre>
  
  <p>and this is line no 90 at DirectUserController</p>
  
  <pre><code>    class DirectUserController @Inject() (var factory:FactoryHandler) extends Controller {
  //other Action code 
  }
  </code></pre>
  
  <p>I have also added code in routes file  </p>
  
  <pre><code>routesGenerator := InjectedRoutesGenerator
  </code></pre>
  
  <p>i am using play framework 2.4 please help me why i am getting this error </p>