title: Play Scala Activator Server having errors while serving requests because of @Inject not working
body: <p>I installed Scala and Activator via Brew on Mac OS. The Activator server run fine and displays following message:-</p>
  
  <pre><code>--- (Running the application, auto-reloading is enabled) ---
  
  [info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
  
  (Server started, use Ctrl+D to stop and go back to the console...) 
  </code></pre>
  
  <p>The server runs fine and gives response for controller:-</p>
  
  <pre><code>class Catalog extends Controller {
    var ws: WSClient = null
    def inStock() = Action.async { implicit request =&gt;
      val url = "http://some.uri.com/random"
      val request : WSRequest = ws.url(url)
      request.withQueryString("productId" -&gt; "1234").get().map { response =&gt;
        Ok(response.json)
      }
    }
  }
  </code></pre>
  
  <p>But when I hit the request via browser at url (localhost:9000/) after altering the controller as:-</p>
  
  <pre><code>class Catalog @Inject() (ws: WSClient) extends Controller {
     def inStock() = Action.async { implicit request =&gt;
          val url = "http://some.uri.com/random"
          val request : WSRequest = ws.url(url)
          request.withQueryString("productId" -&gt; "1234").get().map { response =&gt;
            Ok(response.json)
          }
        }
      }
  </code></pre>
  
  <p>It throws error given below:</p>
  
  <pre><code>    Error in custom provider, java.lang.NumberFormatException: For input string: "port"
            while locating play.api.libs.ws.ning.WSClientProvider
            at play.api.libs.ws.ning.NingWSModule.bindings(NingWS.scala:456):
          Binding(interface play.api.libs.ws.WSClient to Pro
  
  viderConstructionTarget(class play.api.libs.ws.ning.WSClientProvider) in interface javax.inject.Singleton) (via modules: com.google.inject.util.Modules$OverrideModule -&gt; play.api.inject.guice.GuiceableModuleConversions$$anon$1)
        while locating play.api.libs.ws.WSClient
          for parameter 0 at controllers.api.v1.Users.&lt;init&gt;(Users.scala:17)
        while locating controllers.api.v1.Users
          for parameter 6 at router.Routes.&lt;init&gt;(Routes.scala:47)
        while locating router.Routes
        while locating play.api.inject.RoutesProvider
        while locating play.api.routing.Router
      Caused by: java.lang.NumberFormatException: For input string: "port"
          at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
          at java.lang.Integer.parseInt(Integer.java:580)
          at java.lang.Integer.valueOf(Integer.java:766)
          at com.ning.http.util.ProxyUtils.createProxyServerSelector(ProxyUtils.java:160)
          at com.ning.http.client.AsyncHttpClientConfig$Builder.build(AsyncHttpClientConfig.java:1000)
          at play.api.libs.ws.ning.NingAsyncHttpClientConfigBuilder.build(NingConfig.scala:147)
          at play.api.libs.ws.ning.NingWSClient$.apply(NingWS.scala:72)
          at play.api.libs.ws.ning.NingWSAPI.client$lzycompute(NingWS.scala:480)
          at play.api.libs.ws.ning.NingWSAPI.client(NingWS.scala:470)
          at play.api.libs.ws.ning.NingWSAPI.client(NingWS.scala:466)
          at play.api.libs.ws.ning.WSClientProvider.get(NingWS.scala:462)
          at play.api.libs.ws.ning.WSClientProvider.get(NingWS.scala:461)
          at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
          at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
          at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
          at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
          at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
          at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
          at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
          at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
          at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
          at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
          at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
          at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
          at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
          at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
          at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
          at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
          at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
          at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
          at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
          at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
          at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
          at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
          at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
          at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
          at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:69)
          at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:69)
          at scala.Option.fold(Option.scala:158)
          at play.api.inject.RoutesProvider.get$lzycompute(BuiltinModule.scala:69)
          at play.api.inject.RoutesProvider.get(BuiltinModule.scala:65)
          at play.api.inject.RoutesProvider.get(BuiltinModule.scala:64)
          at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
          at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
          at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
          at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
          at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
          at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
          at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
          at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
          at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
          at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
          at play.api.Application$class.routes(Application.scala:112)
          at play.api.DefaultApplication.routes(Application.scala:241)
          at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:90)
          at play.api.Play$$anonfun$start$1.apply(Play.scala:87)
          at play.api.Play$$anonfun$start$1.apply(Play.scala:87)
          at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
          at play.api.Play$.start(Play.scala:87)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:156)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:121)
          at scala.Option.map(Option.scala:146)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:121)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:119)
          at scala.util.Success.flatMap(Try.scala:230)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:119)
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:111)
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
          at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
          at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
          at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
          at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
          at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
  
      5 errors
          at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025) ~[guice-4.0.jar:na]
          at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051) ~[guice-4.0.jar:na]
          at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.Application$class.routes(Application.scala:112) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.DefaultApplication.routes(Application.scala:241) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:90) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.Play$$anonfun$start$1.apply(Play.scala:87) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.Play$$anonfun$start$1.apply(Play.scala:87) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.utils.Threads$.withContextClassLoader(Threads.scala:21) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.api.Play$.start(Play.scala:87) ~[play_2.11-2.4.6.jar:2.4.6]
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:156) ~[play-server_2.11-2.4.6.jar:2.4.6]
          ... 14 common frames omitted
  
  
  
  Following is application.conf
  
      # This is the main configuration file for the application.
      # ~~~~~
  
      # Secret key
      # ~~~~~
      # The secret key is used to secure cryptographics functions.
      #
      # This must be changed for production, but we recommend not changing it in this file.
      #
      # See http://www.playframework.com/documentation/latest/ApplicationSecret for more details.
      play.crypto.secret = "changeme"
  
      # The application languages
      # ~~~~~
      play.i18n.langs = [ "en" ]
  
      # Router
      # ~~~~~
      # Define the Router object to use for this application.
      # This router will be looked up first when the application is starting up,
      # so make sure this is the entry point.
      # Furthermore, it's assumed your route file is named properly.
      # So for an application router like `my.application.Router`,
      # you may need to define a router file `conf/my.application.routes`.
      # Default to Routes in the root package (and conf/routes)
      # play.http.router = my.application.Routes
  
      # Database configuration
      # ~~~~~
      # You can declare as many datasources as you want.
      # By convention, the default datasource is named `default`
      #
      # db.default.driver=org.h2.Driver
      # db.default.url="jdbc:h2:mem:play"
      # db.default.username=sa
      # db.default.password=""
  
      # Evolutions
      # ~~~~~
      # You can disable evolutions if needed
      # play.evolutions.enabled=false
  
      # You can disable evolutions for a specific datasource if necessary
      # play.evolutions.db.default.enabled=false
  </code></pre>
  
  <p>Kindly Help!</p>