Hi,
Play 2.5 uses Netty 4.0, but the ElasticSearch (ES) client uses Netty 4.1. The result is that 4.0 gets evicted and 4.1 used instead...
...And this results in the below null pointer exception when attempting to start Play:
java.lang.NullPointerException
at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:146)
at play.core.server.NettyServer.bind(NettyServer.scala:140)
at play.core.server.NettyServer.play$core$server$NettyServer$$bindChannel(NettyServer.scala:224)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:216)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:216)
at scala.Option.map(Option.scala:146)
at play.core.server.NettyServer.<init>(NettyServer.scala:216)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:279)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:278)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:235)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:65)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:64)
at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:54)
at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:234)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
Currently I'm using ElasticSearch (ES) alpha-5, because that one still uses Netty 4.0 and works with Play. In my case, using an alpha version of ES felt (feels) okay, since my project was (is) in alpha/beta status itself anyway.
But "never" being able to upgrade from alpha-5 could become problematic.
Does someone have some thoughts about what makes sense for me to do? (in order to solve the [cannot upgr from ES-5-alpha to ES-5-final] problem)
What I'm thinking I could do: (and I suppose this can be of interest to anyone who wants to add ES to a Play 2.5 app? — they likely want to use the most recent version of ES (i.e. ES 5 with Netty 4.1))
- Try to make play 2.5 use Netty 4.1, as described in this thread:
("Will Play 2.5.x upgrade to netty 4.1?")
But to me that seems like complicated, and … feels like off-topic work for me.
- Try to backport the ES client to use Netty 4.0 (I can ask in the ES forum about this. But I guess this'd be even more complicated)
- Wait for Play 2.6 to be released? When might that happen? Roughly which month would anyone guess?
- Since my own project is in alpha-beta status itself, a Play 2.6 alpha or beta version would probably be OK in my case.
Does anyone know when a 2.6 alpha or beta might be available?
Thanks for building Play b.t.w., & best regards,
KajMagnus