From 9d4adefb48f14457fb61fd938a969c4e9dc860a0 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 11 Oct 2023 11:28:47 +0200 Subject: [PATCH] IBM Db2 - Register resource bundle classes for reflection As usual with Db2, we are shooting in the dark a bit but it seems to solve the OP's issue. Fixes #36399 (cherry picked from commit 78d5bc37b579d2b8a0b1e0c6e65d45fe8a3b360c) --- .../jdbc/db2/deployment/JDBCDB2Processor.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java index fd03be59a5aed..107b700ca788b 100644 --- a/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java +++ b/extensions/jdbc/jdbc-db2/deployment/src/main/java/io/quarkus/jdbc/db2/deployment/JDBCDB2Processor.java @@ -1,5 +1,15 @@ package io.quarkus.jdbc.db2.deployment; +import com.ibm.db2.jcc.resources.ResourceKeys; +import com.ibm.db2.jcc.resources.Resources; +import com.ibm.db2.jcc.resources.SqljResources; +import com.ibm.db2.jcc.resources.T2uResourceKeys; +import com.ibm.db2.jcc.resources.T2uResources; +import com.ibm.db2.jcc.resources.T2zResourceKeys; +import com.ibm.db2.jcc.resources.T2zResources; +import com.ibm.db2.jcc.resources.T4ResourceKeys; +import com.ibm.db2.jcc.resources.T4Resources; + import io.quarkus.agroal.spi.JdbcDriverBuildItem; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; import io.quarkus.arc.processor.BuiltinScope; @@ -55,12 +65,23 @@ void configureAgroalConnection(BuildProducer additional } @BuildStep - void registerDriverForReflection(BuildProducer reflectiveClass) { + void registerForReflection(BuildProducer reflectiveClass) { //Not strictly necessary when using Agroal, as it also registers //any JDBC driver being configured explicitly through its configuration. //We register it for the sake of people not using Agroal, //for example when the driver is used with OpenTelemetry JDBC instrumentation. reflectiveClass.produce(ReflectiveClassBuildItem.builder(DB2_DRIVER_CLASS).build()); + + // register resource bundles for reflection (they are apparently classes...) + reflectiveClass.produce(ReflectiveClassBuildItem.builder(Resources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(ResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(SqljResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2uResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2uResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2zResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T2zResources.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T4ResourceKeys.class).build()); + reflectiveClass.produce(ReflectiveClassBuildItem.builder(T4Resources.class).build()); } @BuildStep