From baf612ced12afef53062a80d29bfe2ebcac06d94 Mon Sep 17 00:00:00 2001 From: Christian Wimmer Date: Tue, 11 Jul 2023 23:28:28 -0700 Subject: [PATCH] Workarounds for wrong class initialization configuration in microservice frameworks --- java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py index 656b15590ac5..2bd6a06211c3 100644 --- a/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py +++ b/java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py @@ -374,7 +374,6 @@ def extra_image_build_argument(self, benchmark, args): '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jni=ALL-UNNAMED', '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.threadlocal=ALL-UNNAMED', '--initialize-at-run-time=io.netty.internal.tcnative.SSL,io.netty.handler.codec.compression.ZstdOptions', - '--initialize-at-build-time=org.apache.pdfbox.rendering.ImageType', '-H:+StackTrace'] + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args) @@ -397,7 +396,10 @@ def extra_image_build_argument(self, benchmark, args): if mx.get_jdk().version < expectedJdkVersion: mx.abort(benchmark + " needs at least JDK version " + str(expectedJdkVersion)) - return super(BaseTikaBenchmarkSuite, self).extra_image_build_argument(benchmark, args) + return [ + # Workaround for wrong class initialization configuration in Quarkus Tika + '--initialize-at-build-time=org.apache.pdfbox.rendering.ImageType,org.apache.pdfbox.rendering.ImageType$1,org.apache.pdfbox.rendering.ImageType$2,org.apache.pdfbox.rendering.ImageType$3,org.apache.pdfbox.rendering.ImageType$4', + ] + super(BaseTikaBenchmarkSuite, self).extra_image_build_argument(benchmark, args) class TikaWrkBenchmarkSuite(BaseTikaBenchmarkSuite, mx_sdk_benchmark.BaseWrkBenchmarkSuite): @@ -467,6 +469,9 @@ def build_assertions(self, benchmark, is_gate): def extra_image_build_argument(self, benchmark, args): return [ '--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED', + # Workaround for wrong class initialization configuration in Micronaut 3.9 + '--initialize-at-build-time=io.netty.handler.codec.http.cookie.ServerCookieEncoder', + '--initialize-at-build-time=org.xml.sax.helpers.AttributesImpl,org.xml.sax.helpers.LocatorImpl', ] + super(BaseMicronautBenchmarkSuite, self).extra_image_build_argument(benchmark, args) def default_stages(self):