2016-09-11 55 views
4

及彼ChannelException是一些堆棧跟蹤時加入谷歌的雲客戶端庫播放2.5

io.netty.channel.ChannelException: Unable to create Channel from class class io.netty.channel.socket.nio.NioServerSocketChannel 
at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:41) 
at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:318) 
at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:282) 
at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:246) 
at play.core.server.NettyServer.bind(NettyServer.scala:139) 
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) 
Caused by: java.lang.NoSuchMethodError: io.netty.channel.DefaultChannelId.newInstance()Lio/netty/channel/DefaultChannelId; 

的我加了這樣的depedency在我build.sbt文件

libraryDependencies += "com.google.cloud" % "google-cloud" % "0.3.0" 

這隻發生當我添加Google雲庫時。我不確定這是否存在庫或框架問題

回答

12

谷歌雲使用的netty版本與Play使用的netty版本衝突。這將排除Google雲的網絡,以支持Play's。

libraryDependencies += ("com.google.cloud" % "google-cloud" % "0.3.0").excludeAll(ExclusionRule(organization = "io.netty")) 

但是,如果您嘗試使用需要gRPC的功能,它將失敗。詳細信息:

https://groups.google.com/forum/#!topic/play-framework/UUDZZRpAv3w https://github.com/playframework/netty-reactive-streams/pull/17

解決辦法有兩個:

A.降級谷歌雲到0.2.2,您可以通過重命名神器gcloud,用java做:

"com.google.cloud" % "gcloud-java" % "0.2.2" 

B.降級回放到2.4.6

相關問題