From c0b8e8b0d7abc35af4c74905c2d98a4cf95e3357 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Fri, 17 Mar 2023 14:16:57 +0100 Subject: [PATCH] Workaround for #770 Figure out whether io.quarkus.awt.runtime.graal.AwtFeature and DarwinAwtFeature can be transformed to RuntimeInitializedPackageBuildItem --- .../cxf/deployment/CxfClientProcessor.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/extensions/core/deployment/src/main/java/io/quarkiverse/cxf/deployment/CxfClientProcessor.java b/extensions/core/deployment/src/main/java/io/quarkiverse/cxf/deployment/CxfClientProcessor.java index c296650c0..947bdf409 100644 --- a/extensions/core/deployment/src/main/java/io/quarkiverse/cxf/deployment/CxfClientProcessor.java +++ b/extensions/core/deployment/src/main/java/io/quarkiverse/cxf/deployment/CxfClientProcessor.java @@ -13,6 +13,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Predicate; import java.util.stream.Collectors; +import java.util.stream.Stream; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Produces; @@ -63,6 +64,7 @@ import io.quarkus.gizmo.MethodCreator; import io.quarkus.gizmo.MethodDescriptor; import io.quarkus.gizmo.ResultHandle; +import io.quarkus.runtime.util.JavaVersionUtil; /** * Find WebService implementations and deploy them. @@ -89,6 +91,19 @@ void collectClients( .map(RuntimeInitializedPackageBuildItem::getPackageName) .collect(Collectors.toSet()); + /* Workaround for https://github.com/quarkiverse/quarkus-cxf/issues/770 */ + Stream.of( + "com.sun.imageio", + "java.awt", + "javax.imageio", + "sun.awt", + "sun.font", + "sun.java2d") + .forEach(rtInitPackages::add); + if (JavaVersionUtil.isJava17OrHigher()) { + rtInitPackages.add("sun.lwawt.macosx"); + } + final AtomicBoolean hasRuntimeInitializedProxy = new AtomicBoolean(false); final Map clientSEIsInUse = findClientSEIsInUse(index, config); CxfDeploymentUtils.webServiceAnnotations(index)