Error on starting up play 2.5.18 application


(Aman Sinha) #1

We just migrated to play 2.5.18.
The code changes are done but after upgradation the jvm is shutting down with the below mentioned error.
Any idea what this is about? It’s been a week and I have been stuck on this.

[info] play.api.Play - Application started (Dev)

Uncaught error from thread []: play/libs/F$Function, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[application]

java.lang.NoClassDefFoundError: play/libs/F$Function
at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(
	at java.lang.Class.getDeclaredConstructors(
	at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
	at play.core.j.DefaultJavaHandlerComponents.getAction(JavaAction.scala:142)
	at play.core.j.JavaAction$$anonfun$6.apply(JavaAction.scala:91)
	at play.core.j.JavaAction$$anonfun$6.apply(JavaAction.scala:89)
	at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57)
	at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66)
	at scala.collection.mutable.ArraySeq.foldLeft(ArraySeq.scala:46)
	at play.core.j.JavaAction.apply(JavaAction.scala:89)
	at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:112)
	at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:112)
	at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
	at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:111)
	at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:110)
	at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:110)
	at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:103)
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
	at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
	at akka.dispatch.BatchingExecutor$
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(

(Patrick Li) #2

Looks like your code base still has references to F.Function, which if I remember correctly, is replaced (or is recommended to be replaced by) Java 8 classes. If you are sure your own code does not use the class, it is probably one of the libraries you are depending on and you will need to upgrade those to Play 2.5.18 compatible ones.

(Aman Sinha) #3

I don’t have any reference made to it.
I guess I have upgraded all the libraries. I will recheck it once and get back.
Thanks for the response.

(Aman Sinha) #4

Same thing. All jars are updated still the same error.

(Christian Kaps) #5

Have your tried to clean your cache or remove your target directory before you compile the application?

sbt clean

(Marcos Pereira) #6

Hi @asinha07,

You don’t necessarily need to have a direct reference to the dependency. sbt - and most of dependency management tools - resolves dependency in a transitive way too. So, for example, if your projects depend on a dependency A, and A depends on B, and B depends on C, then your project depends on C because of the transitive nature of dependencies. This means that your project is not explicitly declaring a dependency on an older version of Play, but it still there.

You can use sbt-dependency-graph to see the whole dependency tree and then discover which dependency is adding the older version of Play.


(Aman Sinha) #7

Hi guys, I have resolved the issue.
I was actually using an external custom jar on top of the jars mentioned on build.sbt
That external jar was having a reference to F.Function. The issue is solved now.