Skip to content

[Java][Flight] grpc-netty, version mismatch, incompatible ctor for "PooledByteBufAllocator" in io.grpc.netty.Utils#createByteBufAllocator  #347

@asfimport

Description

@asfimport

Using Arrow nightly jars from 03/03/2022

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())

This throws the following error (from "FlightServer.builder")

'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)

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:

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")
}

Reporter: Gavin Ray

Original Issue Attachments:

Note: This issue was originally created as ARROW-15861. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions