Skip to content

Commit

Permalink
Netty PlatformDependent0.<init> uses DirectByteBuffer reflectively
Browse files Browse the repository at this point in the history
Since we moved `io.netty.util.internal.PlatformDependent`'s and
`io.netty.util.internal.PlatformDependent0`' initialization at runtime
we need to register `java.nio.DirectByteBuffer`'s constructors for
reflective access to avoid miss-configurations due to not being able to
access the constructor in
https://github.com/netty/netty/blob/5db037beedca8aa5b6a486fa515cc6af013ced74/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L290-L292

More classes and methods need to be registered as discussed in
quarkusio#37626

Closes Karm/mandrel-integration-tests#236
  • Loading branch information
zakkak committed Dec 8, 2023
1 parent af6d3d7 commit 263e64c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ NativeImageConfigBuildItem build(
.produce(ReflectiveClassBuildItem.builder("java.util.LinkedHashMap").build());
reflectiveClass.produce(ReflectiveClassBuildItem.builder("sun.nio.ch.SelectorImpl").methods().fields().build());

// Setup reflective accesses happening in PlatformDependent0 static initializer
reflectiveClass.produce(ReflectiveClassBuildItem.builder("java.nio.DirectByteBuffer").constructors().build());


String maxOrder = calculateMaxOrder(config.allocatorMaxOrder, minMaxOrderBuildItems, false);

NativeImageConfigBuildItem.Builder builder = NativeImageConfigBuildItem.builder()
Expand Down

0 comments on commit 263e64c

Please sign in to comment.