diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 28bcbfe8b791e..0a2f2868cfc4e 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -125,7 +125,7 @@ 8.3.0 12.6.3.jre11 1.6.7 - 23.3.0.23.09 + 23.4.0.24.05 10.16.1.1 11.5.8.0 1.2.6 diff --git a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/ExtendedCharactersSupport.java b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/ExtendedCharactersSupport.java index 875f8e1db2349..e01f0ee3f278a 100644 --- a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/ExtendedCharactersSupport.java +++ b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/ExtendedCharactersSupport.java @@ -5,13 +5,12 @@ import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.pkg.NativeConfig; -import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; import io.quarkus.jdbc.oracle.runtime.OracleInitRecorder; public final class ExtendedCharactersSupport { @Record(STATIC_INIT) - @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + @BuildStep public void preinitializeCharacterSets(NativeConfig config, OracleInitRecorder recorder) { recorder.setupCharSets(config.addAllCharsets()); } diff --git a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java index 317dbd961716c..7184b831e6173 100644 --- a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java +++ b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java @@ -12,7 +12,6 @@ import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeReinitializedClassBuildItem; -import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; import io.quarkus.maven.dependency.ArtifactKey; /** @@ -36,7 +35,7 @@ * require it, so this would facilitate the option to revert to the older version in * case of problems. */ -@BuildSteps(onlyIf = NativeOrNativeSourcesBuild.class) +@BuildSteps public final class OracleMetadataOverrides { static final String DRIVER_JAR_MATCH_REGEX = "com\\.oracle\\.database\\.jdbc"; @@ -78,15 +77,6 @@ void build(BuildProducer reflectiveClass) { .constructors().build()); reflectiveClass.produce(ReflectiveClassBuildItem.builder("oracle.sql.AnyDataFactory") .constructors().build()); - reflectiveClass - .produce(ReflectiveClassBuildItem.builder("com.sun.rowset.providers.RIOptimisticProvider") - .build()); - //This is listed in the original metadata, but it doesn't actually exist: - // reflectiveClass.produce(ReflectiveClassBuildItem.builder("oracle.jdbc.logging.annotations.Supports") - // .constructors().methods().build()); - //This is listed in the original metadata, but it doesn't actually exist: - // reflectiveClass.produce(ReflectiveClassBuildItem.builder("oracle.jdbc.logging.annotations.Feature") - // .constructors().methods().build()); } @BuildStep @@ -133,6 +123,15 @@ void runtimeInitializeDriver(BuildProducer run runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.xa.client.OracleXAHeteroConnection")); runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.driver.T4CXAConnection")); runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.security.o5logon.O5Logon")); + + //These were missing in the original driver, and apparently in its automatic feature definitions as well; + //the need was spotted by running the native build: GraalVM will complain about these types having initialized fields + //referring to various other types which aren't allowed in a captured heap. + runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.diagnostics.Diagnostic")); + runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.replay.driver.FailoverManagerImpl")); + runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.diagnostics.CommonDiagnosable")); + runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.replay.driver.TxnFailoverManagerImpl")); + runtimeInitialized.produce(new RuntimeInitializedClassBuildItem("oracle.jdbc.diagnostics.OracleDiagnosticsMXBean")); } @BuildStep diff --git a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleNativeImage.java b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleNativeImage.java index 8167b900a952e..1ea683e1a37a5 100644 --- a/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleNativeImage.java +++ b/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleNativeImage.java @@ -3,6 +3,7 @@ import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.AdditionalIndexedClassesBuildItem; +import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; /** @@ -10,6 +11,11 @@ */ public final class OracleNativeImage { + @BuildStep + NativeImageFeatureBuildItem staticNativeImageFeature() { + return new NativeImageFeatureBuildItem("oracle.jdbc.nativeimage.NativeImageFeature"); + } + /** * Registers the {@code oracle.jdbc.driver.OracleDriver} so that it can be loaded * by reflection, as commonly expected. diff --git a/integration-tests/jpa-oracle/src/main/java/io/quarkus/example/jpaoracle/SerializationTestEndpoint.java b/integration-tests/jpa-oracle/src/main/java/io/quarkus/example/jpaoracle/SerializationTestEndpoint.java index ff7132a9c93c5..4f2198680a28b 100644 --- a/integration-tests/jpa-oracle/src/main/java/io/quarkus/example/jpaoracle/SerializationTestEndpoint.java +++ b/integration-tests/jpa-oracle/src/main/java/io/quarkus/example/jpaoracle/SerializationTestEndpoint.java @@ -11,8 +11,11 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; +import io.quarkus.runtime.annotations.RegisterForReflection; + @Path("/jpa-oracle/testserialization") @Produces(MediaType.TEXT_PLAIN) +@RegisterForReflection(targets = { String.class }, serialization = true) public class SerializationTestEndpoint { @GET