我正在使用Finagle节俭,但是当我构建服务器和服务时
val service = new EchoService$FinagleService(new EchoServiceImpl, new TBinaryProtocol.Factory())
val server = Thrift.server.serveIface("localhost:8080", service)我运行它,我收到了一个例外:
Exception in thread "main" java.lang.NoSuchMethodError: com.twitter.finagle.server.StackServer.$init$(Lcom/twitter/finagle/server/StackServer;)V
at com.twitter.finagle.Thrift$Server.<init>(Thrift.scala:417)
Disconnected from the target VM, address: '127.0.0.1:60647', transport: 'socket'
at com.twitter.finagle.Thrift$.server(Thrift.scala:495)发布于 2018-03-06 08:00:23
我觉得你要么打电话
val service = new EchoService$FinagleService(new EchoServiceImpl, new TBinaryProtocol.Factory())
val server = Thrift.server.serve("localhost:8080", service)或
val server = Thrift.server.serveIface("localhost:8080", EchoServiceImpl)但我认为这不能解决NoSuchMethodError,它似乎是一个版本兼容性问题。我会首先检查Finagle版本和Scrooge版本,确保它们在同一个页面上。
https://stackoverflow.com/questions/48971928
复制相似问题