playframework/play-samples

Cross-version check in Akka HTTP cause failure on play-grpc samples

ignasi35 opened this issue · 1 comments

Cross-version check in Akka HTTP cause failure on play-grpc samples

Hi! I think I may have run into the same problem. On a fresh clone of the repo from e230763, I wanted to run the play-scala-grpc-example. I executed sbt runProd, as suggested in the documentation of the example. The server seems to have started, but immediately crashed:

(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
 
[jetty-alpn-agent][ warn] Could not find a matching alpn-boot jar for Java version: 11.0.7
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/zoltan/Personal/play-samples/play-scala-grpc-example/target/universal/stage/lib/com.google.inject.guice-4.2.3.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] a.e.s.Slf4jLogger - Slf4jLogger started
[info] play.api.Play - Application started (Prod) (no global state)
[warn] a.u.ManifestInfo - You are using version 10.1.12 of Akka HTTP, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 10.1.12 of the [akka-http] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
Oops, cannot start the server.
java.lang.IllegalStateException: You are using version 10.1.12 of Akka HTTP, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 10.1.12 of the [akka-http] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
	at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:217)
	at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:195)
	at akka.http.scaladsl.HttpExt.<init>(Http.scala:78)
	at akka.http.scaladsl.Http$.createExtension(Http.scala:1132)
	at akka.http.scaladsl.Http$.createExtension(Http.scala:901)
	at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1145)
	at akka.actor.ExtensionId.apply(Extension.scala:78)
	at akka.actor.ExtensionId.apply$(Extension.scala:77)
	at akka.http.scaladsl.Http$.apply(Http.scala:1127)
	at play.core.server.AkkaHttpServer.createServerBinding(AkkaHttpServer.scala:189)
	at play.core.server.AkkaHttpServer.$anonfun$httpServerBinding$1(AkkaHttpServer.scala:218)
	at play.core.server.AkkaHttpServer.$anonfun$httpServerBinding$1$adapted(AkkaHttpServer.scala:214)
	at scala.Option.map(Option.scala:163)
	at play.core.server.AkkaHttpServer.<init>(AkkaHttpServer.scala:214)
	at play.core.server.AkkaHttpServerProvider.createServer(AkkaHttpServer.scala:664)
	at play.core.server.AkkaHttpServerProvider.createServer(AkkaHttpServer.scala:662)
	at play.core.server.ServerProvider.createServer(ServerProvider.scala:29)
	at play.core.server.ServerProvider.createServer$(ServerProvider.scala:26)
	at play.core.server.AkkaHttpServerProvider.createServer(AkkaHttpServer.scala:662)
	at play.core.server.ProdServerStart$.start(ProdServerStart.scala:60)
	at play.core.server.ProdServerStart$.main(ProdServerStart.scala:30)
	at play.core.server.ProdServerStart.main(ProdServerStart.scala)
2020-07-06 23:00:02,993 shutdown-hooks-run-all ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2

As suggested by the error message, I bumped the version of akka-http from 10.1.11 to 10.1.12, which seems to have solved it, as the server now starts without an error. I created #108 to address the issue.