Hi,
Just performed a huge front end refactoring on my play 2.3 app, in this transition, I got some strange errors in reverse routing.
Take this action :
public static Result catalogByCategory(String category) {
// ...
}
Mapped on that route :
GET /catalog/category/:c controllers.Catalog.catalogByCategory(c: String)
When I call the reverse routing in any view, for example like this :
@routes.Catalog.catalogByCategory(OperationCategory.DIVERS.toString)
I get one error highlighting saying this :
Type mismatch, expected Nothing, actual String.
My code doesn't compile since this, and just after the application launches I get this pretty error (who's not coming from any top-level application file) :
play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
at play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.10.jar:2.3.10]
at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.10.jar:2.3.10]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [play_2.11-2.3.10.jar:2.3.10]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [play_2.11-2.3.10.jar:2.3.10]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) [scala-library-2.11.6.jar:na]
Caused by: java.lang.NullPointerException: null
at scala.Predef$.Integer2int(Predef.scala:357) ~[scala-library-2.11.6.jar:na]
at play.api.mvc.PathBindable$$anonfun$bindableJavaInteger$4.apply(Binders.scala:554) ~[play_2.11-2.3.10.jar:2.3.10]
at play.api.mvc.PathBindable$$anonfun$bindableJavaInteger$4.apply(Binders.scala:554) ~[play_2.11-2.3.10.jar:2.3.10]
at play.api.mvc.PathBindable$$anon$2.unbind(Binders.scala:185) ~[play_2.11-2.3.10.jar:2.3.10]
at controllers.ReverseClients.history(routes_reverseRouting.scala:3818) ~[classes/:na]
I don't know whether to take the bull by the horns or the tail, is it a bug due to Play framework directly ?
Thanks for your time,