When I try to compile my project I get the following exception:
! Internal server error, for request [GET /] ->
play.api.UnexpectedException: Unexpected exception [StackOverflowError: null]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:233) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:226) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4.apply(PlayReloader.scala:226) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4.apply(PlayReloader.scala:224) ~[na:na]
at scala.Either$LeftProjection.map(Either.scala:183) ~[scala-library.jar:0.11.3]
java.lang.StackOverflowError: null
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:731) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4138) ~[scala-compiler.jar:na]
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:731) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271) ~[scala-compiler.jar:na]
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353) ~[scala-compiler.jar:na]
I found the same issue in the Play 2 issue tracker and they said that when the routes file grows it makes that exception.
Is there a solution to this exception because my project doesn't compile anymore ?
I'm using Play 2.0.3 for scala(my routes file is about 150 line)
I had the same issue with Play 2.0.6. Upgraded to Play 2.0.8 and it didn't help. I then modified the $play_dir/framework/build script so it builds with -Xss2M instead of -Xss1M and the problem disappeared (I can compile normally now).
There is a bug with play 2.0 having to do with the size of the routes file, not in terms of the number of routes but rather the physical size of the file (32768 bytes). It seems that this cieling has increased for 2.0.4 and is eliminated with 2.1.
https://groups.google.com/forum/?fromgroups=#!topic/play-framework/fZvgWJoCPLc
So, first, I would take a look at the physical size of the routes file. It may be possible cut out comments and/or eliminate commented-out lines. Next, I would try upgrading to version 2.0.4. That is a fairly easy process. You just need to download 2.0.4, point
play
to this new path, and update the /project/plugins.sbt of the project to read:A more long-term fix may be to upgrade your project to 2.1 once it becomes stable.