Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Java Play 2.7 "CreationException: Unable to create injector:" #211

Open
Aminot1 opened this issue Jul 25, 2019 · 0 comments
Open

Java Play 2.7 "CreationException: Unable to create injector:" #211

Aminot1 opened this issue Jul 25, 2019 · 0 comments

Comments

@Aminot1
Copy link

Aminot1 commented Jul 25, 2019

I'm getting this error:

scalaVersion := "2.12.8"

$ java -version:
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

Unexpected exception

CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, errors.ObjectNotFoundException: No enum found
  at service.UnitsService.<init>(UnitsService.java:34)
  at service.UnitsService.class(UnitsService.java:34)
  while locating service.UnitsService
    for field at controllers.UnitsController.unitsServce(UnitsController.java:33)
  while locating controllers.UnitsController
    for the 7th parameter of router.Routes.<init>(Routes.scala:66)
  while locating router.Routes
  while locating play.api.inject.RoutesProvider
  while locating play.api.routing.Router
    for the 2nd parameter of play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:35)
  while locating play.modules.swagger.SwaggerPluginImpl
  at play.modules.swagger.SwaggerModule.bindings(SwaggerModule.scala:11):
Binding(interface play.modules.swagger.SwaggerPlugin to ConstructionTarget(class play.modules.swagger.SwaggerPluginImpl) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)
  while locating play.modules.swagger.SwaggerPlugin

1 error
No source available, here is the exception stack trace:

->com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, errors.ObjectNotFoundException: No enum found
  at service.UnitsService.<init>(UnitsService.java:34)
  at service.UnitsService.class(UnitsService.java:34)
  while locating service.UnitsService
    for field at controllers.UnitsController.unitsServce(UnitsController.java:33)
  while locating controllers.UnitsController
    for the 7th parameter of router.Routes.<init>(Routes.scala:66)
  while locating router.Routes
  while locating play.api.inject.RoutesProvider
  while locating play.api.routing.Router
    for the 2nd parameter of play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:35)
  while locating play.modules.swagger.SwaggerPluginImpl
  at play.modules.swagger.SwaggerModule.bindings(SwaggerModule.scala:11):
Binding(interface play.modules.swagger.SwaggerPlugin to ConstructionTarget(class play.modules.swagger.SwaggerPluginImpl) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)
  while locating play.modules.swagger.SwaggerPlugin

1 error

     com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)

     com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)

     com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)

     com.google.inject.Guice.createInjector(Guice.java:87)

     com.google.inject.Guice.createInjector(Guice.java:78)

     play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:201)

     play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:156)

     play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:22)

     play.core.server.DevServerStart$$anon$1.$anonfun$reload$3(DevServerStart.scala:193)

     play.utils.Threads$.withContextClassLoader(Threads.scala:22)

     play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:185)

     play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:144)

     play.core.server.ssl.ServerSSLEngine$.createSSLEngineProvider(ServerSSLEngine.scala:34)

     play.core.server.AkkaHttpServer$$anon$2$$anon$3.sslEngineProvider$lzycompute(AkkaHttpServer.scala:534)

     play.core.server.AkkaHttpServer$$anon$2$$anon$3.sslEngineProvider(AkkaHttpServer.scala:533)

     play.core.server.AkkaHttpServer$$anon$2$$anon$3.engineCreateSSLEngine(AkkaHttpServer.scala:535)

     javax.net.ssl.SSLContext.createSSLEngine(SSLContext.java:329)

     akka.stream.scaladsl.TLS$.$anonfun$apply$2(TLS.scala:91)

     akka.stream.impl.io.TLSActor.liftedTree1$1(TLSActor.scala:159)

     akka.stream.impl.io.TLSActor.<init>(TLSActor.scala:159)

     akka.stream.impl.io.TLSActor$.$anonfun$props$1(TLSActor.scala:38)

     akka.actor.TypedCreatorFunctionConsumer.produce(IndirectActorProducer.scala:91)

     akka.actor.Props.newActor(Props.scala:212)

     akka.actor.ActorCell.newActor(ActorCell.scala:648)

     akka.actor.ActorCell.create(ActorCell.scala:674)

     akka.actor.ActorCell.invokeAll$1(ActorCell.scala:547)

     akka.actor.ActorCell.systemInvoke(ActorCell.scala:569)

     akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:293)

     akka.dispatch.Mailbox.run(Mailbox.scala:228)

     akka.dispatch.Mailbox.exec(Mailbox.scala:241)

     akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)

     akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)

     akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)

     akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
@Aminot1 Aminot1 changed the title Java Play 2.7 Java Play 2.7 "CreationException: Unable to create injector:" Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant