Issue Provision Exception

java

(Anton Menke) #1

Hello, I am new to lagom and play framework. I want to run the lagom chirper example (https://github.com/lagom/lagom-java-maven-chirper-example/) and I get this provision exception.

com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for com.lightbend.lagom.javadsl.server.LagomServiceRouter was bound.
  while locating com.lightbend.lagom.javadsl.server.LagomServiceRouter
  while locating play.api.inject.RoutesProvider
  while locating play.api.routing.Router
    for the 1st parameter of play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:217)
  while locating play.api.http.JavaCompatibleHttpRequestHandler
  while locating play.api.http.HttpRequestHandler
    for the 6th parameter of play.api.DefaultApplication.<init>(Application.scala:236)
  at play.api.DefaultApplication.class(Application.scala:235)
  while locating play.api.DefaultApplication
  while locating play.api.Application

1 error
     com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1028)
     com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
     play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:409)
     play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:404)
     play.api.inject.ContextClassLoaderInjector.$anonfun$instanceOf$2(Injector.scala:117)
     play.api.inject.ContextClassLoaderInjector.withContext(Injector.scala:126)
     play.api.inject.ContextClassLoaderInjector.instanceOf(Injector.scala:117)
     play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
     play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
     play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$5(LagomReloadableDevServerStart.scala:176)
     play.utils.Threads$.withContextClassLoader(Threads.scala:21)
     play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$3(LagomReloadableDevServerStart.scala:173)
     scala.Option.map(Option.scala:146)
     play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$2(LagomReloadableDevServerStart.scala:149)
     scala.util.Success.flatMap(Try.scala:247)
     play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$1(LagomReloadableDevServerStart.scala:147)
     scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)
     scala.util.Success.$anonfun$map$1(Try.scala:251)
     scala.util.Success.map(Try.scala:209)
     scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
     scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
     scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
     scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
     java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
     java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
     java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
     java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
     java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Can you help me fix this problem? Thank you!


(Aditya Athalye) #2

It might help to just post your Guice module file here.


(Anton Menke) #3
public final class Guice {
    private Guice() {
    }

    public static Injector createInjector(Module... modules) {
        return createInjector((Iterable)Arrays.asList(modules));
    }

    public static Injector createInjector(Iterable<? extends Module> modules) {
        return createInjector(Stage.DEVELOPMENT, modules);
    }

    public static Injector createInjector(Stage stage, Module... modules) {
        return createInjector(stage, (Iterable)Arrays.asList(modules));
    }

    public static Injector createInjector(Stage stage, Iterable<? extends Module> modules) {
        return (new InternalInjectorCreator()).stage(stage).addModules(modules).build();
    }
}

(Tim Moore) #4

@Anton have you made changes to the example, or are you trying to run it straight after cloning it from GitHub?