Gavin Ray created ARROW-15861:
---------------------------------
Summary: [Java][Flight] grpc-netty, version mismatch, incompatible
ctor for "PooledByteBufAllocator" in io.grpc.netty.Utils#createByteBufAllocator
Key: ARROW-15861
URL: https://issues.apache.org/jira/browse/ARROW-15861
Project: Apache Arrow
Issue Type: Bug
Components: FlightRPC, Java
Affects Versions: 8.0.0
Reporter: Gavin Ray
Attachments: image-2022-03-07-10-47-09-355.png
Using Arrow nightly jars from 03/03/2022
{code:java}
val LOCALHOST = "localhost"
val allocator = RootAllocator(Long.MAX_VALUE)
val serverLocation = Location.forGrpcInsecure(LOCALHOST, 0)
val producer = DataWrapperFlightSQLProducer(serverLocation)
val server = FlightServer.builder(allocator, serverLocation,
producer).build().start()
val clientLocation = Location.forGrpcInsecure(LOCALHOST, server.port)
val client = FlightSqlClient(FlightClient.builder(allocator,
clientLocation).build())
{code}
This throws the following error (from "FlightServer.builder")
{code:java}
'void io.netty.buffer.PooledByteBufAllocator.<init>(boolean, int, int, int,
int, int, int, boolean)'
java.lang.NoSuchMethodError: 'void
io.netty.buffer.PooledByteBufAllocator.<init>(boolean, int, int, int, int, int,
int, boolean)'
at io.grpc.netty.Utils.createByteBufAllocator(Utils.java:176)
at io.grpc.netty.Utils.access$000(Utils.java:75)
at
io.grpc.netty.Utils$ByteBufAllocatorPreferDirectHolder.<clinit>(Utils.java:97)
at io.grpc.netty.Utils.getByteBufAllocator(Utils.java:144)
at io.grpc.netty.NettyServer.start(NettyServer.java:205)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:183)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:92)
at org.apache.arrow.flight.FlightServer.start(FlightServer.java:83)
at
FlightSQLServerAndClientTest.<clinit>(FlightSQLServerAndClientTest.kt:33)
{code}
The reason is because the constructor is incompatible:
!image-2022-03-07-10-47-09-355.png!
To fix this, you can override Arrow's dependencies versions:
{code:groovy}
implementation("io.grpc", "grpc-netty").version {
strictly("1.44.1")
}
implementation("io.netty", "netty-all").version {
strictly("4.1.74.Final")
}
implementation("io.netty", "netty-codec").version {
strictly("4.1.74.Final")
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)