9

我正在尝试在我的 play scala 服务(Play v2.5.7)中使用谷歌云数据存储,因此我google-cloud在 build.sbt 中添加了依赖项

"com.google.cloud" % "google-cloud" % "0.4.0",

服务器在没有依赖关系的情况下启动良好。但是添加依赖后,播放服务器启动会报错:

[info] Loading global plugins from /<redacted>/.sbt/0.13/plugins
[info] Loading project definition from /<redacted>/dev/auth-svc/project
[info] Set current project to authsvc (in build file:/<redacted>/auth-svc/)

--- (Running the application, auto-reloading is enabled) ---

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)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 1 s, completed Oct 6, 2016 12:50:18 AM

有什么线索吗?

4

1 回答 1

2

OP 所说的解决方案可以通过两种方式工作:将 google-cloud 降级到 0.2.2 或将 Play 降级到 2.4.6。在 Play Framework Google Group 中有一个相关的广泛讨论,在“<a href="https://github.com/playframework/netty-reactive-streams/pull/ 中提出了一种解决方法类型的解决方案。 17" rel="nofollow noreferrer">升级到 Netty 4.1.5.Final 和 Akka Streams 2.4.10” github 上的对话。

于 2017-03-08T21:57:06.807 回答