[scaldi-play 0.5.8] Injecting WSClient

34 views
Skip to first unread message

Neil Chaudhuri

unread,
Sep 13, 2015, 3:52:25 AM9/13/15
to scaldi
How can I inject Play's built-in WSClient? It doesn't seem to be one of the dependencies provided out-of-the-box by Scaldi as it is by Play's default Guice implementation.

Oleg Ilyenko

unread,
Sep 13, 2015, 8:34:42 AM9/13/15
to scaldi
Hi Neil,

I just verified that it is possible to inject `WSClient` like this (it's injected and I able to use to make HTTP requests to external services):

val ws = inject [WSClient]

Maybe you forgot a library dependency on `ws`, e.g.:

libraryDependencies ++= Seq(
  ws,
  "org.scaldi" %% "scaldi-play" % "0.5.8",
  // ...
)

or maybe you forgot to define an application loader in `conf/application.conf`:

play.application.loader = scaldi.play.ScaldiApplicationLoader

I would suggest to double check the config, but it it still does not work, it would be very helpful if you could post a minified example that reproduces an issue.

Cheers,
Oleg

Neil Chaudhuri

unread,
Sep 13, 2015, 9:24:43 AM9/13/15
to scaldi
It was indeed a config issue. Thanks a lot.
Reply all
Reply to author
Forward
0 new messages