Skip to content

Commit

Permalink
Netty requires more classes to be runtime initialized
Browse files Browse the repository at this point in the history
In quarkusio#37347 we moved
`PlatformDependent` and `PlatformDependent0` classes to
run-time-initialization as they are platform-dependent and thus need to
be initialized on the target platform. It looks like there are more
classes like these that need to be runtime initialized as they
transitively rely on platform dependent values.

Closes Karm/mandrel-integration-tests#236

Supersedes quarkusio#37628
  • Loading branch information
zakkak committed Dec 11, 2023
1 parent af6d3d7 commit 72d7b79
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,28 @@ NativeImageConfigBuildItem build(
log.debug("Not registering Netty native kqueue classes as they were not found");
}

builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent");
builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0");
builder.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent")
.addRuntimeReinitializedClass("io.netty.util.internal.PlatformDependent0")
.addRuntimeReinitializedClass("io.netty.buffer.PooledByteBufAllocator");

if (QuarkusClassLoader.isClassPresentAtRuntime("io.netty.buffer.UnpooledByteBufAllocator")) {
builder.addRuntimeReinitializedClass("io.netty.buffer.UnpooledByteBufAllocator")
.addRuntimeReinitializedClass("io.netty.buffer.Unpooled")
.addRuntimeReinitializedClass("io.vertx.core.http.impl.Http1xServerResponse")
.addRuntimeReinitializedClass("io.netty.handler.codec.http.HttpObjectAggregator")
.addRuntimeReinitializedClass("io.netty.handler.codec.ReplayingDecoderByteBuf")
.addRuntimeReinitializedClass("io.vertx.core.parsetools.impl.RecordParserImpl");

if (QuarkusClassLoader.isClassPresentAtRuntime("io.vertx.ext.web.client.impl.MultipartFormUpload")) {
builder.addRuntimeReinitializedClass("io.vertx.ext.web.client.impl.MultipartFormUpload");
}

if (QuarkusClassLoader
.isClassPresentAtRuntime("org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartFormUpload")) {
builder.addRuntimeReinitializedClass(
"org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartFormUpload");
}
}

return builder //TODO: make configurable
.build();
Expand Down

0 comments on commit 72d7b79

Please sign in to comment.