[Scala-2.6] ClassNotFoundException: play.api.mvc.BodyParsers$parse$

1,626 views
Skip to first unread message

Johan Dahlberg

unread,
Mar 29, 2017, 6:10:24 AM3/29/17
to Play Framework
I am writing a new project with deadbolt in Play 2.6-M3 but I can't get it to work. I keep getting "ClassNotFoundException: play.api.mvc.BodyParsers$parse$"

Is it something that I have missed that have changed?

package controllers

import be.objectify.deadbolt.scala.DeadboltActions
import dal._
import java.util.UUID
import javax.inject._

import play.api._
import play.api.data.Form
import play.api.data.Forms._
import play.api.mvc.Controller

import scala.concurrent.{Await, ExecutionContext, Future}
import scala.concurrent.duration._

class UserController @Inject()(accountRepo: AccountRepository, deadbolt: DeadboltActions)(implicit ec: ExecutionContext) extends Controller {

  /**
   * The mapping for the person form.
   */
  lazy val loginForm = Form(
    ...
  )

  def authenticate = deadbolt.SubjectNotPresent()() { authRequest =>
    Future {
      loginForm.bindFromRequest()(authRequest).fold(
        formWithErrors => {
          BadRequest(views.html.login(formWithErrors))
        },
        user => {
          ...
        }
      )
    }
  }

  def login = deadbolt.SubjectNotPresent()() { authRequest =>
    Future {
      Ok(views.html.login(loginForm))
    }
  }

  def logout = deadbolt.SubjectPresent()() { authRequest =>
    ...
  }
}

play.api.UnexpectedException: Unexpected exception[ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:178)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:128)
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:128)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:126)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:126)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2215)
at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:138)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:550)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2215)
at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:138)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:550)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
Caused by: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:572)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:558)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
Caused by: java.lang.ClassNotFoundException: play.api.mvc.BodyParsers$parse$
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)

/Johan

Johan Dahlberg

unread,
Mar 29, 2017, 6:53:32 AM3/29/17
to Play Framework
To be clear, I guess that it's Deadbolt that causes the problem but what has changed in Play 2.6 so I might make the necessary changes.

/Johan

Will Sargent

unread,
Mar 29, 2017, 1:05:37 PM3/29/17
to play-fr...@googlegroups.com
You want PlayBodyParsers -- the docs say BodyParsers$parse$ is deprecated, not removed though:


--
Will Sargent
Engineer, Lightbend, Inc.


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/925a0842-102e-4450-a120-255cc8bb37d7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Will Sargent

unread,
Mar 29, 2017, 1:05:53 PM3/29/17
to play-fr...@googlegroups.com

Greg Methvin

unread,
Mar 29, 2017, 4:36:28 PM3/29/17
to play-framework
I'm assuming there is no deadbolt for 2.6 now? 2.6 isn't binary compatible with 2.5.


For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

Tarık Şahin

unread,
Oct 20, 2017, 5:04:25 AM10/20/17
to Play Framework
Hi everybody.I got this error too while i was updating my play version from 2.5.10 to 2.6.6.Is there any solution to resolve this problem.Here is my error:

ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;

29 Mart 2017 Çarşamba 13:10:24 UTC+3 tarihinde Johan Dahlberg yazdı:

Johan Dahlberg

unread,
Oct 20, 2017, 5:09:49 AM10/20/17
to Play Framework
You need to give more info. Full stack trace and the code where it's triggered.

/Johan

Igmar Palsenberg

unread,
Oct 20, 2017, 5:11:48 AM10/20/17
to Play Framework


Op vrijdag 20 oktober 2017 11:04:25 UTC+2 schreef Tarık Şahin:
Hi everybody.I got this error too while i was updating my play version from 2.5.10 to 2.6.6.Is there any solution to resolve this problem.Here is my error:

ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;

One of your plugin is for 2.5. 2.6 isn't binary compatible with 2.6.


Igmar

Tarık Şahin

unread,
Oct 20, 2017, 11:38:06 AM10/20/17
to Play Framework
play.api.UnexpectedException: Unexpected exception[ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;]
        at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.reload(DevServerStart.scala:186)
        at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.get(DevServerStart.scala:124)
        at play.core.server.AkkaHttpServer.play$core$server$AkkaHttpServer$$modelConversion(AkkaHttpServer.scala:183)
        at play.core.server.AkkaHttpServer.play$core$server$AkkaHttpServer$$handleRequest(AkkaHttpServer.scala:189)
        at play.core.server.AkkaHttpServer$$anonfun$5.apply(AkkaHttpServer.scala:106)
        at play.core.server.AkkaHttpServer$$anonfun$5.apply(AkkaHttpServer.scala:106)
        at akka.stream.impl.fusing.MapAsync$$anon$23.onPush(Ops.scala:1172)
        at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:499)
        at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:462)
        at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:368)
        at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:571)
        at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:457)
        at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:546)
        at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:725)
        at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:740)
        at akka.actor.Actor$class.aroundReceive(Actor.scala:514)
        at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:650)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:527)
        at akka.actor.ActorCell.invoke(ActorCell.scala:496)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
        at akka.dispatch.Mailbox.run(Mailbox.scala:224)
        at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
        at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
        at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
        at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
        at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:138)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:550)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:808)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:285)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:217)
        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1009)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1041)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
        at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:409)
        at play.api.inject.ContextClassLoaderInjector$$anonfun$instanceOf$3.apply(Injector.scala:118)
        at play.api.inject.ContextClassLoaderInjector.withContext(Injector.scala:126)
        at play.api.inject.ContextClassLoaderInjector.instanceOf(Injector.scala:118)
        at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:104)
        at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:104)
        at scala.Option.fold(Option.scala:158)
        at play.api.inject.RoutesProvider.get$lzycompute(BuiltinModule.scala:104)
        at play.api.inject.RoutesProvider.get(BuiltinModule.scala:100)
        at play.api.inject.RoutesProvider.get(BuiltinModule.scala:99)
        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.SingleParameterInjector.inject(SingleParameterInjector.java:38)
        at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        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:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
        at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
        at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
        at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
        at com.google.inject.Guice.createInjector(Guice.java:99)
        at com.google.inject.Guice.createInjector(Guice.java:84)
        at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
        at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
        at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
        at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$1.apply(DevServerStart.scala:174)
        at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$1.apply(DevServerStart.scala:171)
        at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
        at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.reload(DevServerStart.scala:171)
        ... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredFields(Class.java:1916)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
        at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
        at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)
        at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:572)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:558)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:808)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:285)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:217)
        at com.google.inject.internal.InjectorImpl.createParameterInjector(InjectorImpl.java:965)
        at com.google.inject.internal.InjectorImpl.getParametersInjectors(InjectorImpl.java:953)
        at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:71)
        at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
        at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
        ... 122 common frames omitted
Caused by: java.lang.ClassNotFoundException: play.api.mvc.BodyParsers$parse$
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 146 common frames omitted


I used "bodyparsers" in this code .It is triggered by all Actions.

class MyAction @Inject() (parser: BodyParsers.Default)(implicit cc:ExecutionContext) extends ActionBuilderImpl(parser) with Logging {
override def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]): Future[Result] = {
val start = System.currentTimeMillis
val ip = request.headers.get("client-ip").map(ip => s" - ip: $ip").getOrElse("")
val futureResult = block(request).map { result =>
val end = System.currentTimeMillis
result.withHeaders("Request-Time" -> (end - start).toString)
}.recover{ case x =>
logger.error(s"Request failed ${request.method} $requestUrl failed $ip $requestBody", x)
throw x
}

futureResult
}
}

Thanks for your help.


20 Ekim 2017 Cuma 12:09:49 UTC+3 tarihinde Johan Dahlberg yazdı:

Tarık Şahin

unread,
Oct 21, 2017, 8:17:37 AM10/21/17
to Play Framework
Can you give me any advice how i can find that plugin and how to solve this problem.It is realy annoying me to get this error at run time.And I have not solved this problem yet.Thanks for your help.

20 Ekim 2017 Cuma 12:11:48 UTC+3 tarihinde Igmar Palsenberg yazdı:

Greg Methvin

unread,
Oct 21, 2017, 2:24:31 PM10/21/17
to play-framework
If you can find the original stack trace with all the frames, you usually will see which library is trying to use the old class.

Normally sbt will display an eviction warning when it has to choose one of several potentially incompatible versions and will tell you which dependencies are using the older version. Unfortunately these warnings are easy to ignore because sbt assumes a specific versioning scheme that isn't the same for all libraries, but they usually are accurate for Play libraries.

You can also use a tool like sbt-dependency-graph to see which libraries are still depending on 2.5.x.

Cheers,
Greg

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tarık Şahin

unread,
Oct 23, 2017, 2:41:56 AM10/23/17
to Play Framework
Thank you very much.I will consider your advice.I can see eviction warnings.If i can solve my problem i will write solution steps.Thanks again.

21 Ekim 2017 Cumartesi 21:24:31 UTC+3 tarihinde Greg Methvin yazdı:
If you can find the original stack trace with all the frames, you usually will see which library is trying to use the old class.

Normally sbt will display an eviction warning when it has to choose one of several potentially incompatible versions and will tell you which dependencies are using the older version. Unfortunately these warnings are easy to ignore because sbt assumes a specific versioning scheme that isn't the same for all libraries, but they usually are accurate for Play libraries.

You can also use a tool like sbt-dependency-graph to see which libraries are still depending on 2.5.x.

Cheers,
Greg
On Sat, Oct 21, 2017 at 7:17 AM, Tarık Şahin <tariksa...@gmail.com> wrote:
Can you give me any advice how i can find that plugin and how to solve this problem.It is realy annoying me to get this error at run time.And I have not solved this problem yet.Thanks for your help.

20 Ekim 2017 Cuma 12:11:48 UTC+3 tarihinde Igmar Palsenberg yazdı:


Op vrijdag 20 oktober 2017 11:04:25 UTC+2 schreef Tarık Şahin:
Hi everybody.I got this error too while i was updating my play version from 2.5.10 to 2.6.6.Is there any solution to resolve this problem.Here is my error:

ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;

One of your plugin is for 2.5. 2.6 isn't binary compatible with 2.6.


Igmar

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Tarık Şahin

unread,
Oct 27, 2017, 4:37:37 AM10/27/17
to Play Framework
All eviction warnings are here.None of this libararies is using play.api.mvc.BodyParsers.parse.But I am still getting the same error.Is BodyParsers' classpath in play 2.6.x different from play 2.5.x?Classloader can not load this class.


[warn] Here are some of the libraries that were evicted:
[warn]  * com.typesafe.akka:akka-actor_2.11:(2.5.4, 2.4.19) -> 2.5.6 (caller: com.typesafe.akka:akka-remote_2.11:2.5.6 (), com.typesafe.akka:akka-parsing_2.11:10.0.10, com.typesafe.akka:akka-stream_2.11:2.5.4, com.typesafe.akka:akka-persistence_2.11:2.5.6 (), c
om.typesafe.akka:akka-stream_2.11:2.5.6 (), tr.com.mkk.api:kapi_2.11:1.0.13-SNAPSHOT, com.typesafe.play:play_2.11:2.6.6, com.typesafe.akka:akka-agent_2.11:2.5.6 (), com.typesafe.akka:akka-slf4j_2.11:2.5.6 ())
[warn]  * com.typesafe.akka:akka-stream_2.11:(2.5.4, 2.5.3, 2.4.19) -> 2.5.6 (caller: com.typesafe.play:play-streams_2.11:2.6.6, com.typesafe.akka:akka-remote_2.11:2.5.6 (), com.typesafe.play:play-ws-standalone_2.11:1.1.2, com.typesafe.akka:akka-http-core_2.11:
10.0.10)
[warn]  * com.google.guava:guava:(19.0, 15.0) -> 22.0 (caller: com.google.inject:guice:4.1.0, com.typesafe.play:play_2.11:2.6.6, com.jolbox:bonecp:0.8.0.RELEASE)
[warn]  * org.scala-lang.modules:scala-java8-compat_2.11:0.7.0 -> 0.8.0 (caller: com.typesafe.play:play-streams_2.11:2.6.6, com.typesafe.play:play_2.11:2.6.6, com.typesafe.akka:akka-actor_2.11:2.5.6 (), com.typesafe.play:play-ahc-ws-standalone_2.11:1.1.2)
[info] Here are other libraries that were evicted:
[info]  * com.typesafe.akka:akka-slf4j_2.11:2.5.4 -> 2.5.6 (caller: tr.com.mkk.api:kapi_2.11:1.0.13-SNAPSHOT, com.typesafe.play:play_2.11:2.6.6)
[info]  * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.1, 1.0.4, 1.0.5) -> 1.0.6 (caller: com.typesafe:ssl-config-core_2.11:0.2.1, com.typesafe.play:anorm_2.11:2.5.0, com.typesafe.play:cachecontrol_2.11:1.1.2, com.typesafe:ssl-config-core_2.11:0.2.
2, com.typesafe.play:play_2.11:2.6.6)
[info]  * org.joda:joda-convert:1.2 -> 1.7 (caller: com.github.nscala-time:nscala-time_2.11:1.0.0, com.typesafe.play:anorm_2.11:2.5.0, com.typesafe.play:cachecontrol_2.11:1.1.2)
[info]  * net.sf.ehcache:ehcache:2.8.3 -> 2.10.4 (caller: org.ehcache:jcache:1.0.1, com.typesafe.play:play-ehcache_2.11:2.6.6)
[info]  * com.typesafe:ssl-config-core_2.11:0.2.1 -> 0.2.2 (caller: com.typesafe.akka:akka-stream_2.11:2.5.4, com.typesafe.akka:akka-stream_2.11:2.5.6 (), com.typesafe.play:play-ws-standalone_2.11:1.1.2)
[info]  * com.typesafe.play:play-json_2.11:2.6.0 -> 2.6.6 (caller: com.typesafe.play:play-ws-standalone-json_2.11:1.1.2, tr.com.mkk.api:kapi_2.11:1.0.13-SNAPSHOT, com.typesafe.play:play_2.11:2.6.6)
[info]  * joda-time:joda-time:(2.3, 2.7, 2.6) -> 2.9.9 (caller: com.github.nscala-time:nscala-time_2.11:1.0.0, com.typesafe.play:anorm_2.11:2.5.0, com.typesafe.play:cachecontrol_2.11:1.1.2, com.typesafe.play:play-json_2.11:2.6.6)
[info]  * com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9 -> 2.8.10 (caller: com.typesafe.play:play_2.11:2.6.6, com.typesafe.play:play-json_2.11:2.6.6)
[info]  * com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.9 -> 2.8.10 (caller: com.typesafe.play:play_2.11:2.6.6, com.typesafe.play:play-json_2.11:2.6.6)
[info]  * com.fasterxml.jackson.core:jackson-databind:(2.4.2, 2.8.2, 2.8.9) -> 2.8.10 (caller: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.10, io.jsonwebtoken:jjwt:0.7.0, io.dropwizard.metrics:metrics-json:3.1.2, com.typesafe.play:play_2.11:2.6.6,
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.10, com.typesafe.play:play-json_2.11:2.6.6)
[info]  * com.fasterxml.jackson.core:jackson-annotations:(2.8.9, 2.8.0) -> 2.8.10 (caller: com.typesafe.play:play_2.11:2.6.6, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.10, com.typesafe.play:play-json_2.11:2.6.6, com.fasterxml.jackson.core:jacks
on-databind:2.8.10)
[info]  * com.fasterxml.jackson.core:jackson-core:2.8.9 -> 2.8.10 (caller: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.10, com.typesafe.play:play_2.11:2.6.6, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.10, com.typesafe.play:play-json
_2.11:2.6.6, com.fasterxml.jackson.core:jackson-databind:2.8.10)
[info]  * ch.qos.logback:logback-classic:(1.1.2, 1.1.3) -> 1.2.3 (caller: me.moocar:logback-gelf:0.3, com.typesafe.play:play-logback_2.11:2.6.6, io.dropwizard.metrics:metrics-logback:3.1.2)
[info]  * ch.qos.logback:logback-core:1.1.3 -> 1.2.3 (caller: ch.qos.logback:logback-classic:1.2.3, me.moocar:socket-encoder-appender:0.1beta1)
[info]  * com.typesafe:config:1.2.0 -> 1.3.1 (caller: com.typesafe:ssl-config-core_2.11:0.2.1, com.typesafe:ssl-config-core_2.11:0.2.2, com.typesafe.akka:akka-actor_2.11:2.5.6 ())
[info]  * org.reactivestreams:reactive-streams:1.0.0 -> 1.0.1 (caller: com.typesafe.play:play-streams_2.11:2.6.6, com.typesafe.akka:akka-stream_2.11:2.5.4, com.typesafe.akka:akka-stream_2.11:2.5.6 (), com.typesafe.play:play-ahc-ws-standalone_2.11:1.1.2, com.typ
esafe.play:play-iteratees-reactive-streams_2.11:2.6.1)
[info]  * org.slf4j:slf4j-api:(1.7.12, 1.6.0, 1.7.22, 1.6.1, 1.7.7, 1.5.10, 1.7.2) -> 1.7.25 (caller: net.sf.ehcache:ehcache:2.10.4, org.ehcache:jcache:1.0.1, com.typesafe.play:cachecontrol_2.11:1.1.2, com.typesafe.play:play_2.11:2.6.6, ch.qos.logback:logback-c
lassic:1.2.3, com.zaxxer:HikariCP:2.7.1, com.typesafe.play:play-ahc-ws-standalone_2.11:1.1.2, com.typesafe.akka:akka-slf4j_2.11:2.5.6 (), io.dropwizard.metrics:metrics-jvm:3.1.2, org.slf4j:jcl-over-slf4j:1.7.25, com.googlecode.usc:jdbcdslog:1.0.6.2, io.dropwiza
rd.metrics:metrics-core:3.1.2, me.moocar:logback-gelf:0.3, org.slf4j:jul-to-slf4j:1.7.25, io.dropwizard.metrics:metrics-logback:3.1.2, io.dropwizard.metrics:metrics-json:3.1.2, com.typesafe.play:play-netty-utils:2.6.6, me.moocar:socket-encoder-appender:0.1beta1
, com.jolbox:bonecp:0.8.0.RELEASE, org.mongodb:casbah-commons_2.11:3.1.1)

21 Ekim 2017 Cumartesi 21:24:31 UTC+3 tarihinde Greg Methvin yazdı:
If you can find the original stack trace with all the frames, you usually will see which library is trying to use the old class.

Normally sbt will display an eviction warning when it has to choose one of several potentially incompatible versions and will tell you which dependencies are using the older version. Unfortunately these warnings are easy to ignore because sbt assumes a specific versioning scheme that isn't the same for all libraries, but they usually are accurate for Play libraries.

You can also use a tool like sbt-dependency-graph to see which libraries are still depending on 2.5.x.

Cheers,
Greg
On Sat, Oct 21, 2017 at 7:17 AM, Tarık Şahin <tariksa...@gmail.com> wrote:
Can you give me any advice how i can find that plugin and how to solve this problem.It is realy annoying me to get this error at run time.And I have not solved this problem yet.Thanks for your help.

20 Ekim 2017 Cuma 12:11:48 UTC+3 tarihinde Igmar Palsenberg yazdı:


Op vrijdag 20 oktober 2017 11:04:25 UTC+2 schreef Tarık Şahin:
Hi everybody.I got this error too while i was updating my play version from 2.5.10 to 2.6.6.Is there any solution to resolve this problem.Here is my error:

ExecutionError: java.lang.NoClassDefFoundError: Lplay/api/mvc/BodyParsers$parse$;

One of your plugin is for 2.5. 2.6 isn't binary compatible with 2.6.


Igmar

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Greg Methvin

unread,
Oct 28, 2017, 2:11:49 AM10/28/17
to play-framework
BodyParsers.parse is not an object anymore in Play 2.6. You have some class somewhere that is using it, which probably means it was compiled against 2.5.x and needs to be recompiled against 2.6.x. It would be very helpful to see the full stack trace (including root cause) of that NoClassDefFoundError, as that would very likely tell you which library it is.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ce43feee-8116-4689-98db-26922d468062%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tarık Şahin

unread,
Nov 2, 2017, 8:17:47 AM11/2/17
to Play Framework
None of classes created by me is using bodyparsers.I removed my own MyAction class that i wrote above and used default Action to handle requests.I am still getting the same error.Actually BodyParsers.parse is deprecated in play 2.6.x. It has not removed completely yet.So why i am getting the same error.

I completely deleted all compiled classes and recompiled them.Result is same.


I used sbt-dependency-graph.I wrote dependencies on com.typesafe.play:play_2.11:2.6.6


"com.typesafe.play:play-server_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-guice_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:filters-helpers_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-logback_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-ehcache_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-ws_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-jdbc-api_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"
"com.typesafe.play:play-cache_2.11:2.6.6" -> "com.typesafe.play:play_2.11:2.6.6"

28 Ekim 2017 Cumartesi 09:11:49 UTC+3 tarihinde Greg Methvin yazdı:

Marcos Pereira

unread,
Nov 2, 2017, 6:20:00 PM11/2/17
to play-fr...@googlegroups.com
This looks like a dependency hell to me. Do something like `sbt dependencyTree | grep play` and see if you have some older version of Play being evicted.

Best.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/fd523f34-a009-43a6-81df-a088ea8f6aab%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

Dave Canfield

unread,
Nov 28, 2017, 2:50:24 AM11/28/17
to Play Framework
Hi.  Did you ever resolve this issue?  I'm facing the exact thing now when trying to upgrade to Play 2.6.  Thanks.

Johan Dahlberg

unread,
Nov 28, 2017, 3:19:17 AM11/28/17
to Play Framework
You need to get rid of all the dependencies on play from before 2.6.

Did you try with "sbt dependencyTree | grep play" like Marcos suggested?

/Johan

Dave Canfield

unread,
Nov 29, 2017, 4:41:27 PM11/29/17
to Play Framework
Hi Johan.   Yes, I've poured over the output from dependencyTree a number of times but I haven't found anything "hanging around" from Play 2.5.8 (which is what I'm trying to upgrade from).  There are no references in my code base to BodyParsers.parsers and I'm left scratching my head as to what could be causing this.  

Tarık Şahin

unread,
Dec 5, 2017, 7:14:10 AM12/5/17
to Play Framework
Hi. com.typesafe.play:play_2.11:2.6.6 is the library that contains bodyparsers.parse.I have already written all dependencies on this library and none of them is using bodyparser.parse method.Dave said the same thing about this problem.I think this is about sbt tool.I think sbt produces wrong classpath.

28 Kasım 2017 Salı 11:19:17 UTC+3 tarihinde Johan Dahlberg yazdı:
Reply all
Reply to author
Forward
0 new messages