diff --git a/archetypes/archetypes/src/main/archetype/mp/custom/database-outputs.xml b/archetypes/archetypes/src/main/archetype/mp/custom/database-outputs.xml index 359ddee62fe..d4ce58570fc 100644 --- a/archetypes/archetypes/src/main/archetype/mp/custom/database-outputs.xml +++ b/archetypes/archetypes/src/main/archetype/mp/custom/database-outputs.xml @@ -364,7 +364,7 @@ For details on an Oracle Docker image, see https://github.com/oracle/docker-imag com.oracle.database.jdbc - ucp + ucp11 runtime diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 8900330c6aa..9f0bdaf0215 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -128,12 +128,8 @@ 5.12.0 4.1.115.Final 3.46.1 - 21 - - ${version.lib.ojdbc.family}.15.0.0 + 23 + ${version.lib.ojdbc.family}.6.0.24.10 ${version.lib.ojdbc} 3.4.0 diff --git a/integrations/cdi/datasource-ucp/pom.xml b/integrations/cdi/datasource-ucp/pom.xml index e28694b2cda..05534bb34f1 100644 --- a/integrations/cdi/datasource-ucp/pom.xml +++ b/integrations/cdi/datasource-ucp/pom.xml @@ -47,7 +47,7 @@ com.oracle.database.jdbc - ucp + ucp11 compile diff --git a/integrations/cdi/datasource-ucp/src/main/java/io/helidon/integrations/datasource/ucp/cdi/UCPBackedDataSourceExtension.java b/integrations/cdi/datasource-ucp/src/main/java/io/helidon/integrations/datasource/ucp/cdi/UCPBackedDataSourceExtension.java index c3b4e3fa19e..edd5ca0e588 100644 --- a/integrations/cdi/datasource-ucp/src/main/java/io/helidon/integrations/datasource/ucp/cdi/UCPBackedDataSourceExtension.java +++ b/integrations/cdi/datasource-ucp/src/main/java/io/helidon/integrations/datasource/ucp/cdi/UCPBackedDataSourceExtension.java @@ -184,12 +184,14 @@ private static PoolDataSource createDataSource(Instance instance, for (PropertyDescriptor pd : pds) { if (propertyName.equals(pd.getName())) { // We have matched a Java Beans property on the PoolDataSource implementation class. Set it - // if we can. Note that these properties are NOT those of the PoolDataSource's *underlying* - // "real" connection factory (usually a DataSource that provides the actual connections - // ultimately pooled by the Universal Connection Pool). Those are handled in a manner - // unfortunately restricted by the limited configuration mechanism belonging to the - // PoolDataSource implementation itself via the connectionFactoryProperties object. See - // below. + // if we can. PoolDataSourceImpl Java Beans properties happen to be either String-, int-, + // long-, or boolean-typed properties only. + // + // Note that these properties are NOT those of the PoolDataSource's *underlying* "real" + // connection factory (usually a DataSource that provides the actual connections ultimately + // pooled by the Universal Connection Pool). Those are handled in a manner unfortunately + // restricted by the limited configuration mechanism belonging to the PoolDataSource + // implementation itself via the connectionFactoryProperties object. See below. Method writeMethod = pd.getWriteMethod(); if (writeMethod != null) { Class type = pd.getPropertyType(); @@ -210,68 +212,29 @@ private static PoolDataSource createDataSource(Instance instance, } } if (!handled) { - // We have found a property that is not a Java Beans property of the PoolDataSource, but is - // supposed to be a property of the connection factory that it wraps. + // We have found a property that is not a writable Java Beans property of the PoolDataSource, + // but is supposed to be a writable Java Beans property of the connection factory that it wraps. // - // (Sadly, "serviceName" and "pdbRoles" are special properties that have significance to certain - // connection factories (such as Oracle database-oriented DataSources), and to the - // oracle.ucp.jdbc.UCPConnectionBuilder class, which underlies getConnection(user, password) - // calls, but which sadly cannot be set on a PoolDataSource except by means of some irrelevant - // XML configuration. We work around this design and special case it below, not here.) - // - // Sadly, the Universal Connection Pool lacks a mechanism to tunnel arbitrary Java + // Sadly, the Universal Connection Pool lacks a mechanism to send *arbitrarily-typed* Java // Beans-conformant property values destined for the underlying connection factory (which is - // usually a DataSource or ConnectionPoolDataSource implementation, but may be other things) - // through to that underlying connection factory with arbitrary type information set - // properly. Because the PoolDataSource is in charge of instantiating the connection factory - // (the underlying DataSource), you can't pass a fully configured DataSource into it, nor can - // you access an unconfigured instance of it that you can work with. The only configuration the - // Universal Connection Pool supports is via a Properties object, whose values are retrieved by - // the PoolDataSource implementation, as Strings. This limits the kinds of underlying - // connection factories (DataSource implementations, usually) that can be fully configured with - // the Universal Connection Pool to Strings and those Strings which can be converted by the - // PoolDataSourceImpl#toBasicType(String, String) method. + // usually a DataSource or ConnectionPoolDataSource implementation, but may be other things) to + // that underlying connection factory. Because the PoolDataSource is in charge of instantiating + // the connection factory, you can't pass a fully configured DataSource into it, nor can you + // access an unconfigured instance of it that you can work with. The only configuration the + // Universal Connection Pool supports sending to the connection factory is via a Properties + // object, whose values are retrieved by the PoolDataSource implementation, as Strings. This + // limits the kinds of underlying connection factories (DataSource implementations, usually) + // that can be fully configured with the Universal Connection Pool to Strings and those Strings + // which can be converted by the PoolDataSourceImpl#toBasicType(String, String) method. connectionFactoryProperties.setProperty(propertyName, properties.getProperty(propertyName)); } } } - Object serviceName = connectionFactoryProperties.remove("serviceName"); - Object pdbRoles = connectionFactoryProperties.remove("pdbRoles"); - // Used for OCI ATP Integration - // Removing this so that it is not set on connectionFactoryProperties, - // Else we get exception with getConnection using this DS, if its set. - connectionFactoryProperties.remove("tnsNetServiceName"); if (!connectionFactoryProperties.stringPropertyNames().isEmpty()) { // We found some String-typed properties that are destined for the underlying connection factory to - // hopefully fully configure it. Apply them here. + // hopefully fully configure it. Apply them here. returnValue.setConnectionFactoryProperties(connectionFactoryProperties); } - // Set the PoolDataSource's serviceName property so that it appears to the PoolDataSource to have been set - // via the undocumented XML configuration that the PoolDataSource can apparently be configured with in - // certain (irrelevant for Helidon) application server cases. - if (serviceName instanceof String) { - try { - Method m = returnValue.getClass().getDeclaredMethod("setServiceName", String.class); - if (m.trySetAccessible()) { - m.invoke(returnValue, serviceName); - } - } catch (NoSuchMethodException ignoreOnPurpose) { - - } - } - // Set the PoolDataSource's pdbRoles property so that it appears to the PoolDataSource to have been set via - // the undocumented XML configuration that the PoolDataSource can apparently be configured with in certain - // (irrelevant for Helidon) application server cases. - if (pdbRoles instanceof Properties) { - try { - Method m = returnValue.getClass().getDeclaredMethod("setPdbRoles", Properties.class); - if (m.trySetAccessible()) { - m.invoke(returnValue, pdbRoles); - } - } catch (NoSuchMethodException ignoreOnPurpose) { - - } - } } if (returnValue.getConnectionPoolName() == null) { String proposedConnectionPoolName = dataSourceName.value(); diff --git a/integrations/cdi/datasource-ucp/src/test/java/io/helidon/integrations/datasource/ucp/cdi/TestDataSourceAcquisition.java b/integrations/cdi/datasource-ucp/src/test/java/io/helidon/integrations/datasource/ucp/cdi/TestDataSourceAcquisition.java index 1ddd7056287..3863377816a 100644 --- a/integrations/cdi/datasource-ucp/src/test/java/io/helidon/integrations/datasource/ucp/cdi/TestDataSourceAcquisition.java +++ b/integrations/cdi/datasource-ucp/src/test/java/io/helidon/integrations/datasource/ucp/cdi/TestDataSourceAcquisition.java @@ -104,7 +104,6 @@ private void onStartup(@Observes @Initialized(ApplicationScoped.class) final Obj } private void configure(@Observes @Named("test") final PoolDataSource pds) throws SQLException { - assertThat(pds.getServiceName(), is("fred")); assertThat(pds.getDescription(), nullValue()); assertThat(pds.getClass().isSynthetic(), is(false)); pds.setDescription("A test datasource"); diff --git a/integrations/cdi/datasource-ucp/src/test/resources/application.yaml b/integrations/cdi/datasource-ucp/src/test/resources/application.yaml index a668a66a5d6..658158d7ac9 100644 --- a/integrations/cdi/datasource-ucp/src/test/resources/application.yaml +++ b/integrations/cdi/datasource-ucp/src/test/resources/application.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2022 Oracle and/or its affiliates. +# Copyright (c) 2019, 2024 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ oracle: connectionFactoryClassName: org.h2.jdbcx.JdbcDataSource password: "${EMPTY}" user: sa - serviceName: fred PoolXADataSource: testxa: URL: jdbc:h2:mem:test diff --git a/integrations/db/ojdbc/pom.xml b/integrations/db/ojdbc/pom.xml index 03884e9be5d..a0f5664d6bd 100644 --- a/integrations/db/ojdbc/pom.xml +++ b/integrations/db/ojdbc/pom.xml @@ -46,7 +46,7 @@ com.oracle.database.jdbc - ucp + ucp11 diff --git a/jersey/server/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-server/reflect-config.json b/jersey/server/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-server/reflect-config.json new file mode 100644 index 00000000000..356506f69b8 --- /dev/null +++ b/jersey/server/src/main/resources/META-INF/native-image/io.helidon.jersey/helidon-jersey-server/reflect-config.json @@ -0,0 +1,58 @@ +[ + { + "name": "java.lang.Boolean", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Byte", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Double", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Float", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Integer", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Long", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.Short", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.String" ] } + ] + }, + { + "name": "java.lang.String", + "methods": [ + { "name": "", "parameterTypes": [ "java.lang.String" ] }, + { "name": "valueOf", "parameterTypes": [ "java.lang.Object" ] } + ] + } +] diff --git a/messaging/connectors/aq/pom.xml b/messaging/connectors/aq/pom.xml index a8ca7a4d331..00956e6e893 100644 --- a/messaging/connectors/aq/pom.xml +++ b/messaging/connectors/aq/pom.xml @@ -65,10 +65,6 @@ io.helidon.integrations.db ojdbc - - com.oracle.database.jdbc - ucp - jakarta.transaction jakarta.transaction-api diff --git a/tests/integration/packaging/mp-2/pom.xml b/tests/integration/packaging/mp-2/pom.xml index eabc8e7edc5..a275130595f 100644 --- a/tests/integration/packaging/mp-2/pom.xml +++ b/tests/integration/packaging/mp-2/pom.xml @@ -30,6 +30,9 @@ Helidon Tests Integration Packaging MP2 + false + false + false io.helidon.tests.integration.packaging.mp2.Mp2Main true @@ -145,6 +148,11 @@ build-native-image true + + ${angus.activation.native-image.trace} + ${helidon.native.reflection.trace} + ${helidon.native.reflection.trace-parsing} + diff --git a/tests/integration/packaging/mp-2/src/main/resources/META-INF/native-image/io.helidon.tests.integration.packaging/helidon-tests-integration-packaging-mp2/native-image.properties b/tests/integration/packaging/mp-2/src/main/resources/META-INF/native-image/io.helidon.tests.integration.packaging/helidon-tests-integration-packaging-mp2/native-image.properties index 97410fa5a9b..a023fadb1a3 100644 --- a/tests/integration/packaging/mp-2/src/main/resources/META-INF/native-image/io.helidon.tests.integration.packaging/helidon-tests-integration-packaging-mp2/native-image.properties +++ b/tests/integration/packaging/mp-2/src/main/resources/META-INF/native-image/io.helidon.tests.integration.packaging/helidon-tests-integration-packaging-mp2/native-image.properties @@ -14,4 +14,5 @@ # limitations under the License. # -Args=--initialize-at-build-time=io.helidon.tests.integration.packaging.mp2 +Args=--initialize-at-build-time=io.helidon.tests.integration.packaging.mp2 \ + --enable-url-protocols=http diff --git a/tests/integration/packaging/mp-3/pom.xml b/tests/integration/packaging/mp-3/pom.xml index 1dc8f72d106..d5bdf9d9450 100644 --- a/tests/integration/packaging/mp-3/pom.xml +++ b/tests/integration/packaging/mp-3/pom.xml @@ -34,6 +34,9 @@ + false + false + false io.helidon.tests.integration.packaging.mp3.Mp3Main true @@ -83,6 +86,11 @@ native-maven-plugin true + + ${angus.activation.native-image.trace} + ${helidon.native.reflection.trace} + ${helidon.native.reflection.trace-parsing} +