From ccee4646ef2ceed474fbd539c57d77f9089ee1d7 Mon Sep 17 00:00:00 2001 From: Nicolas Filotto Date: Thu, 15 Dec 2022 13:03:35 +0100 Subject: [PATCH] Initialize the class to register first --- .../deployment/steps/NativeImageReflectConfigStep.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageReflectConfigStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageReflectConfigStep.java index 64924f7ba3fae2..806416346fece4 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageReflectConfigStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageReflectConfigStep.java @@ -65,6 +65,12 @@ void generateReflectConfig(BuildProducer reflectConf JsonArrayBuilder root = Json.array(); for (Map.Entry entry : reflectiveClasses.entrySet()) { + try { + Class.forName(entry.getKey(), true, Thread.currentThread().getContextClassLoader()); + } catch (Throwable e) { + // skip me + continue; + } JsonObjectBuilder json = Json.object(); json.put("name", entry.getKey()); @@ -73,7 +79,7 @@ void generateReflectConfig(BuildProducer reflectConf if (info.weak) { json.put("condition", Json.object().put("typeReachable", entry.getKey())); } else if (info.typeReachable != null) { - json.put("condition", Json.object().put("typeReachable", info.typeReachable)); +// json.put("condition", Json.object().put("typeReachable", info.typeReachable)); } if (info.constructors) { json.put("allDeclaredConstructors", true);