From 6f988aa81843f96e069f23cecb221ff0f43c31ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Mon, 30 Sep 2024 18:23:11 +0200 Subject: [PATCH 01/11] remove version duplicities in dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- build.gradle | 6 ++++++ gateway-service/build.gradle | 1 - gradle/versions.gradle | 22 ++++++++++++++-------- platform/build.gradle | 1 + zaas-service/build.gradle | 5 ++++- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 796b81ece5..48eb7ebb39 100644 --- a/build.gradle +++ b/build.gradle @@ -93,6 +93,12 @@ allprojects { } } + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute(module('org.glassfish.jaxb:jaxb-runtime')).using(module('com.sun.xml.bind:jaxb-core:${libs.versions.jaxbImpl.get()}')) + } + } + } configure(subprojects.findAll {it.name != 'platform'}) { diff --git a/gateway-service/build.gradle b/gateway-service/build.gradle index f419549a99..b33c75dfd6 100644 --- a/gateway-service/build.gradle +++ b/gateway-service/build.gradle @@ -82,7 +82,6 @@ dependencies { implementation libs.swagger2.parser implementation libs.swagger3.parser - implementation libs.jaxbApi testImplementation libs.spring.boot.starter.test testImplementation libs.spring.mock.mvc diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 0ea5532307..6a18891dec 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -14,22 +14,26 @@ dependencyResolutionManagement { version('springFramework', '6.1.13') version('springRetry', '2.0.9') + version('glassfishHk2', '3.1.1') version('zosUtils', '2.0.5') version('aws', '1.12.772') version('awaitility', '4.2.2') version('bouncyCastle', '1.78.1') version('caffeine', '3.1.8') version('commonsLang3', '3.17.0') + version('commonsLogging', '1.3.4') version('commonsText', '1.12.0') version('commonsIo', '2.17.0') version('ehCache', '3.10.8') version('eureka', '2.0.3') version('netflixServo', '0.13.2') + version('googleErrorprone', '2.32.0') version('gradleGitProperties', '2.4.2') // Used in classpath dependencies version('gradleNode', '3.6.0') // Used in classpath dependencies version('guava', '33.3.1-jre') // version('hamcrest', '1.3') version('hamcrest', '2.2') + version('httpClient4', '4.5.14') version('httpClient5', '5.4') version('infinispan', '15.0.8.Final') version('jacksonCore', '2.17.2') @@ -39,14 +43,9 @@ dependencyResolutionManagement { version('jakartaValidation', '3.1.0') version('jakartaInject', '2.0.1') version('jakartaServlet', '6.1.0') - version('jaxbApi') { - strictly '[2.3.3,3.0.0[' - prefer '2.3.3' - } - version('jaxbImpl') { - strictly '[2.3.9,3.0.0[' - prefer '2.3.9' - } + version('javaxAnnotation', '1.3.2') + version('jaxbApi', '4.0.2') + version('jaxbImpl', '4.0.5') version('jerseySun', '1.19.4') version('jettyWebSocketClient', '9.4.56.v20240826') version('jettison', '1.5.4') @@ -133,8 +132,11 @@ dependencyResolutionManagement { library('spring_beans', 'org.springframework', 'spring-beans').versionRef('springFramework') library('apache_commons_lang3', 'org.apache.commons', 'commons-lang3').versionRef('commonsLang3') + library('apache_commons_logging', 'commons-logging', 'commons-logging').versionRef('commonsLogging') // to define minimum version and avoid duplicity libraries in the classpath library('apache_commons_text', 'org.apache.commons', 'commons-text').versionRef('commonsText') + library('aopalliance', 'org.glassfish.hk2.external', 'aopalliance-repackaged').versionRef('glassfishHk2') // to define minimum version and avoid duplicity libraries in the classpath + library('hk2_api', 'org.glassfish.hk2', 'hk2-api').versionRef('glassfishHk2') // to define minimum version and avoid duplicity libraries in the classpath library('apache_velocity', 'org.apache.velocity', 'velocity-engine-core').versionRef('velocity') library('awaitility', 'org.awaitility', 'awaitility').versionRef('awaitility') library('aws_bom', 'com.amazonaws', 'aws-java-sdk-bom').versionRef('aws') @@ -144,9 +146,12 @@ dependencyResolutionManagement { library('commons_io', 'commons-io', 'commons-io').versionRef('commonsIo') library('eh_cache', 'org.ehcache', 'ehcache').versionRef('ehCache') library('eureka_jersey_client', 'com.netflix.eureka', 'eureka-client-jersey3').versionRef('eureka') + library('google_errorprone', 'com.google.errorprone', 'error_prone_annotations').versionRef('googleErrorprone') // to define minimum version and avoid duplicity libraries in the classpath library('guava', 'com.google.guava', 'guava').versionRef('guava') library('hamcrest', 'org.hamcrest', 'hamcrest').versionRef('hamcrest') + library('http_client4', 'org.apache.httpcomponents', 'httpclient').versionRef('httpClient4') // to define minimum version and avoid duplicity libraries in the classpath library('http_client5', 'org.apache.httpcomponents.client5', 'httpclient5').versionRef('httpClient5') + library('javax_annotation', 'javax.annotation', 'javax.annotation-api').versionRef('javaxAnnotation') // to define minimum version and avoid duplicity libraries in the classpath library('netflix_servo', 'com.netflix.servo', 'servo-core').versionRef('netflixServo') library('infinispan_spring_boot3_starter_embedded', 'org.infinispan', 'infinispan-spring-boot3-starter-embedded').versionRef('infinispan') @@ -222,6 +227,7 @@ dependencyResolutionManagement { library('gradle_jib_plugin', 'gradle.plugin.com.google.cloud.tools', 'jib-gradle-plugin').versionRef('gradleJibPlugin') library('gradle_test_logger', 'com.adarshr', 'gradle-test-logger-plugin').versionRef('gradleTestLogger') library('micronaut_http_client', 'io.micronaut', 'micronaut-http-client').versionRef('micronaut') + library('micronaut_bom', 'io.micronaut', 'micronaut-core-bom').versionRef('micronaut') library('apache_compress', 'org.apache.commons', 'commons-compress').versionRef('commonsCompress') plugin('gradle_git_properties', 'com.gorylenko.gradle-git-properties').versionRef('gradleGitProperties') diff --git a/platform/build.gradle b/platform/build.gradle index 62c69d2aba..5b278f4cc7 100644 --- a/platform/build.gradle +++ b/platform/build.gradle @@ -19,6 +19,7 @@ dependencies { api(platform(libs.spring.boot.dependencies)) api(platform(libs.netty.bom)) api(platform(libs.aws.bom)) + api(platform(libs.micronaut.bom)) constraints { // to define preferred version (the minimal version constraints) diff --git a/zaas-service/build.gradle b/zaas-service/build.gradle index 1c2677591a..9d8598526c 100644 --- a/zaas-service/build.gradle +++ b/zaas-service/build.gradle @@ -70,6 +70,7 @@ dependencies { implementation libs.jackson.annotations implementation libs.jackson.core implementation libs.jackson.databind + implementation libs.jaxbApi implementation libs.spring.cloud.commons implementation libs.jjwt implementation libs.nimbus.jose.jwt @@ -86,7 +87,9 @@ dependencies { implementation libs.spring.webmvc implementation libs.spring.webflux - implementation libs.eh.cache + implementation(libs.eh.cache) { + exclude group: "jakarta.xml.bind", module: "jakarta.xml.bind-api" + } implementation libs.bundles.jaxb From 3a2283aec675242a626d1b7dff2fa4aa1ed6c2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Mon, 30 Sep 2024 18:47:11 +0200 Subject: [PATCH 02/11] fix lite lib jar for GW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- gateway-service/build.gradle | 1 + gateway-service/gradle/lite.gradle | 64 ++++++++++++++++++++++++++++++ gradle/lite.gradle | 1 + 3 files changed, 66 insertions(+) create mode 100644 gateway-service/gradle/lite.gradle diff --git a/gateway-service/build.gradle b/gateway-service/build.gradle index b33c75dfd6..e67e15c169 100644 --- a/gateway-service/build.gradle +++ b/gateway-service/build.gradle @@ -18,6 +18,7 @@ normalization { } apply plugin: 'org.springframework.boot' +apply from: "$projectDir/gradle/lite.gradle" apply plugin: 'com.google.cloud.tools.jib' apply from: "../gradle/jib.gradle" diff --git a/gateway-service/gradle/lite.gradle b/gateway-service/gradle/lite.gradle new file mode 100644 index 0000000000..5f9f17f21a --- /dev/null +++ b/gateway-service/gradle/lite.gradle @@ -0,0 +1,64 @@ +import org.springframework.boot.gradle.tasks.bundling.BootJar + +/** + * This gradle file extends task `build` to create thin JAR files: + * -lite.jar - contains base SpringBoot part to be executable and built submodules + * -lite-lib.jar - contains all external libraries (except modules) + * + * To run application with thin and library file use: + * java -Dloader.path=-lite-lib-.jar -jar -lite-.jar + * + * Example: + * java -Dloader.path=zowe-rest-api-sample-spring-lite-lib-0.0.1-SNAPSHOT.jar -jar zowe-rest-api-sample-spring-lite-0.0.1-SNAPSHOT.jar + */ + + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath libs.spring.boot.gradle.plugin + } +} + +apply from: "$rootDir/gradle/lite-project.gradle" + +task liteJar(type: BootJar) { + //Do not allow duplicates by ignoring subsequent items to be created at the same path. + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + targetJavaVersion = JavaVersion.VERSION_17 + manifest { + attributes 'Main-Class': 'org.springframework.boot.loader.launch.PropertiesLauncher' + } + def modulesJar = getModulesJarNames() + archiveFileName = getBaseNameLite() + ".jar" + mainClass = getSpringBootApp() + exclude { details -> details.file && details.file.name.endsWith('.jar') && !modulesJar.contains(details.file.name) } + with bootJar + + archiveClassifier = "lite" +} + +configurations { + liteJarConfiguration +} + +artifacts { + liteJarConfiguration(liteJar) { + builtBy(liteJar) + } +} +task liteLibJar(type: Jar) { + archiveFileName = getBaseNameLite() + "-lib.jar" + entryCompression = ZipEntryCompression.STORED + from {configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }} + include '*.jar' + exclude getModulesJarFilters() + with bootJar + + archiveClassifier = "lite-lib" +} + +jar.dependsOn liteLibJar +jar.dependsOn liteJar diff --git a/gradle/lite.gradle b/gradle/lite.gradle index 439fc16346..3df8a0675c 100644 --- a/gradle/lite.gradle +++ b/gradle/lite.gradle @@ -54,6 +54,7 @@ task liteLibJarAll(type: Jar) { } liteLibJarAll.dependsOn(":zaas-service:build") +liteLibJarAll.dependsOn(":gateway-service:build") liteLibJarAll.dependsOn(":discovery-service:build") liteLibJarAll.dependsOn(":api-catalog-services:build") From 80a64e94d1e0f4bbfa852b784d08fdfd0544b919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 12:21:22 +0200 Subject: [PATCH 03/11] revert JAXB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- gateway-service/build.gradle | 1 + gradle/versions.gradle | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gateway-service/build.gradle b/gateway-service/build.gradle index e67e15c169..64ca7d57e6 100644 --- a/gateway-service/build.gradle +++ b/gateway-service/build.gradle @@ -83,6 +83,7 @@ dependencies { implementation libs.swagger2.parser implementation libs.swagger3.parser + implementation libs.bundles.jaxb testImplementation libs.spring.boot.starter.test testImplementation libs.spring.mock.mvc diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 6a18891dec..bc3cc0facc 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -44,8 +44,15 @@ dependencyResolutionManagement { version('jakartaInject', '2.0.1') version('jakartaServlet', '6.1.0') version('javaxAnnotation', '1.3.2') - version('jaxbApi', '4.0.2') - version('jaxbImpl', '4.0.5') + version('jaxbApi') { + strictly '[2.3.3,3.0.0[' + prefer '2.3.3' + } + version('jaxbImpl') { + strictly '[2.3.9,3.0.0[' + prefer '2.3.9' + } + version('jbossLogging', '3.6.0.Final') version('jerseySun', '1.19.4') version('jettyWebSocketClient', '9.4.56.v20240826') version('jettison', '1.5.4') From 0b2ec33830aff62f35b08d53fe42770e3284d5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 12:22:45 +0200 Subject: [PATCH 04/11] JBoss Logging and Joda time fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- gradle/versions.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gradle/versions.gradle b/gradle/versions.gradle index bc3cc0facc..c423605b54 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -58,6 +58,7 @@ dependencyResolutionManagement { version('jettison', '1.5.4') //0.12.x version contains breaking changes version('jjwt', '0.12.6') + version('jodaTime', '2.12.7') version('jsonPath', '2.9.0') version('jsonSmart', '2.5.1') version('junitJupiter', '5.11.0') @@ -174,6 +175,7 @@ dependencyResolutionManagement { library('jakarta_servlet_api', 'jakarta.servlet', 'jakarta.servlet-api').versionRef('jakartaServlet') library('jaxbApi', 'jakarta.xml.bind', 'jakarta.xml.bind-api').versionRef('jaxbApi') library('jaxbImpl', 'com.sun.xml.bind', 'jaxb-impl').versionRef('jaxbImpl') + library('jboss_logging', 'org.jboss.logging', 'jboss-logging').versionRef('jbossLogging') // to define minimum version and avoid duplicity libraries in the classpath library('jetty_client', 'org.eclipse.jetty', 'jetty-client').versionRef('jettyWebSocketClient') library('jetty_http', 'org.eclipse.jetty', 'jetty-http').versionRef('jettyWebSocketClient') library('jetty_io', 'org.eclipse.jetty', 'jetty-io').versionRef('jettyWebSocketClient') @@ -182,6 +184,7 @@ dependencyResolutionManagement { library('jetty_websocket_client', 'org.eclipse.jetty.websocket', 'websocket-client').versionRef('jettyWebSocketClient') library('jetty_websocket_common', 'org.eclipse.jetty.websocket', 'websocket-common').versionRef('jettyWebSocketClient') library('jettison', 'org.codehaus.jettison', 'jettison').versionRef('jettison') + library('joda_time', 'joda-time', 'joda-time').versionRef('jodaTime') // to define minimum version and avoid duplicity libraries in the classpath library('json_smart', 'net.minidev', 'json-smart').versionRef('jsonSmart') library('jjwt', 'io.jsonwebtoken', 'jjwt-api').versionRef('jjwt') library('jjwt_impl', 'io.jsonwebtoken', 'jjwt-impl').versionRef('jjwt') From d89852039f375015594340c97415e1f7cff810e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 14:24:01 +0200 Subject: [PATCH 05/11] remove resolutionStrategy.dependencySubstitution (runtime part is needed for launcher of DS) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- build.gradle | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 48eb7ebb39..5e33593266 100644 --- a/build.gradle +++ b/build.gradle @@ -34,10 +34,12 @@ buildscript { } } -import java.util.regex.Matcher + +import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry import org.gradle.plugins.ide.eclipse.model.AccessRule import org.gradle.plugins.ide.eclipse.model.ClasspathEntry -import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry + +import java.util.regex.Matcher //noinspection GroovyAssignabilityCheck group 'org.zowe.apiml' @@ -93,12 +95,6 @@ allprojects { } } - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute(module('org.glassfish.jaxb:jaxb-runtime')).using(module('com.sun.xml.bind:jaxb-core:${libs.versions.jaxbImpl.get()}')) - } - } - } configure(subprojects.findAll {it.name != 'platform'}) { From cf1d357334cf4999a72cc9adea0133c740f11da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 14:24:18 +0200 Subject: [PATCH 06/11] checkerQual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- gradle/versions.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gradle/versions.gradle b/gradle/versions.gradle index c423605b54..d26c968303 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -20,6 +20,7 @@ dependencyResolutionManagement { version('awaitility', '4.2.2') version('bouncyCastle', '1.78.1') version('caffeine', '3.1.8') + version('checkerQual', '3.43.0') version('commonsLang3', '3.17.0') version('commonsLogging', '1.3.4') version('commonsText', '1.12.0') @@ -151,6 +152,7 @@ dependencyResolutionManagement { library('bcprov', 'org.bouncycastle', 'bcprov-jdk18on').versionRef('bouncyCastle') library('bcpkix', 'org.bouncycastle', 'bcpkix-jdk18on').versionRef('bouncyCastle') library('caffeine', 'com.github.ben-manes.caffeine', 'caffeine').versionRef('caffeine') + library('checker_qual', 'org.checkerframework', 'checker-qual').versionRef('checkerQual') library('commons_io', 'commons-io', 'commons-io').versionRef('commonsIo') library('eh_cache', 'org.ehcache', 'ehcache').versionRef('ehCache') library('eureka_jersey_client', 'com.netflix.eureka', 'eureka-client-jersey3').versionRef('eureka') From cd14f259750f6608e1c8394cd583db27e9cbcdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 16:33:28 +0200 Subject: [PATCH 07/11] attempt to use liteJar by GW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- .../src/main/resources/application.yml | 1 + .../src/main/resources/application.yml | 1 + .../src/main/resources/application.yml | 1 + .../src/main/resources/bin/start.sh | 26 ++++++++++++++++--- .../src/main/resources/application.yml | 1 + .../src/main/resources/application.yml | 1 + 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/api-catalog-services/src/main/resources/application.yml b/api-catalog-services/src/main/resources/application.yml index a9d59f6fbc..426d8077f4 100644 --- a/api-catalog-services/src/main/resources/application.yml +++ b/api-catalog-services/src/main/resources/application.yml @@ -15,6 +15,7 @@ spring: main: allow-circular-references: true banner-mode: ${apiml.banner:"off"} + web-application-type: servlet profiles.group: dev: debug, diag diff --git a/caching-service/src/main/resources/application.yml b/caching-service/src/main/resources/application.yml index 14d934e62b..0e2f51cbde 100644 --- a/caching-service/src/main/resources/application.yml +++ b/caching-service/src/main/resources/application.yml @@ -119,6 +119,7 @@ spring: main: allow-circular-references: true banner-mode: ${apiml.banner:"off"} + web-application-type: servlet springdoc: pathsToMatch: /api/v1/** diff --git a/discovery-service/src/main/resources/application.yml b/discovery-service/src/main/resources/application.yml index 7d83c76ed0..3d817c5ffa 100644 --- a/discovery-service/src/main/resources/application.yml +++ b/discovery-service/src/main/resources/application.yml @@ -55,6 +55,7 @@ spring: main: banner-mode: ${apiml.banner:"off"} allow-circular-references: true + web-application-type: servlet profiles.group: dev: debug, diag diff --git a/gateway-package/src/main/resources/bin/start.sh b/gateway-package/src/main/resources/bin/start.sh index e1a1a1ad7e..4045b56c16 100755 --- a/gateway-package/src/main/resources/bin/start.sh +++ b/gateway-package/src/main/resources/bin/start.sh @@ -84,13 +84,20 @@ if [ -n "${LAUNCH_COMPONENT}" ] then - JAR_FILE="${LAUNCH_COMPONENT}/gateway-service.jar" + JAR_FILE="${LAUNCH_COMPONENT}/gateway-service-lite.jar" else - JAR_FILE="$(pwd)/bin/gateway-service.jar" + JAR_FILE="$(pwd)/bin/gateway-service-lite.jar" fi echo "jar file: "${JAR_FILE} # script assumes it's in the gateway component directory and common_lib needs to be relative path +if [ -z "${CMMN_LB}" ] +then + COMMON_LIB="../apiml-common-lib/bin/api-layer-lite-lib-all.jar" +else + COMMON_LIB=${CMMN_LB} +fi + if [ -z "${LIBRARY_PATH}" ] then LIBRARY_PATH="../common-java-lib/bin/" @@ -122,6 +129,14 @@ else nonStrictVerifySslCertificatesOfServices=false fi +if [ "$(uname)" = "OS/390" ] +then + QUICK_START=-Xquickstart + GATEWAY_LOADER_PATH=${COMMON_LIB},/usr/include/java_classes/IRRRacf.jar +else + GATEWAY_LOADER_PATH=${COMMON_LIB} +fi + ATTLS_ENABLED="false" # ZWE_configs_spring_profiles_active for back compatibility, should be removed in v3 - enabling via Spring profile if [ "${ZWE_zowe_network_server_tls_attls}" = "true" -o "$(echo ${ZWE_configs_spring_profiles_active:-} | awk '/^(.*,)?attls(,.*)?$/')" ]; then @@ -148,7 +163,6 @@ else externalProtocol="http" fi -GATEWAY_LOADER_PATH="" # Check if the directory containing the ZAAS shared JARs was set and append it to the ZAAS loader path if [ -n "${ZWE_GATEWAY_SHARED_LIBS}" ] then @@ -167,6 +181,11 @@ LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/default LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm LIBPATH="$LIBPATH":"${LIBRARY_PATH}" +if [ -n "${ZWE_GATEWAY_LIBRARY_PATH}" ] +then + LIBPATH="$LIBPATH":"${ZWE_GATEWAY_LIBRARY_PATH}" +fi + ADD_OPENS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.nio.channels.spi=ALL-UNNAMED @@ -319,6 +338,7 @@ _BPX_JOBNAME=${ZWE_zowe_job_prefix}${GATEWAY_CODE} ${JAVA_BIN_DIR}java \ -Djdk.tls.client.cipherSuites=${client_ciphers} \ -Djava.protocol.handler.pkgs=com.ibm.crypto.provider \ -Djavax.net.debug=${ZWE_configs_sslDebug:-""} \ + -Dloader.path=${GATEWAY_LOADER_PATH} \ -Djava.library.path=${LIBPATH} \ -Dloader.path=${GATEWAY_LOADER_PATH} \ -jar ${JAR_FILE} & diff --git a/gateway-service/src/main/resources/application.yml b/gateway-service/src/main/resources/application.yml index dd773ffbc5..c518cac452 100644 --- a/gateway-service/src/main/resources/application.yml +++ b/gateway-service/src/main/resources/application.yml @@ -64,6 +64,7 @@ spring: redirectUri: "{baseUrl}/gateway/{action}/oauth2/code/{registrationId}" main: banner-mode: ${apiml.banner:"off"} + web-application-type: reactive springdoc: api-docs: diff --git a/zaas-service/src/main/resources/application.yml b/zaas-service/src/main/resources/application.yml index 10edb7ed2f..2b7e5d3a40 100644 --- a/zaas-service/src/main/resources/application.yml +++ b/zaas-service/src/main/resources/application.yml @@ -112,6 +112,7 @@ spring: main: banner-mode: ${apiml.banner:"off"} allow-circular-references: true + web-application-type: servlet springdoc: writer-with-order-by-keys: true From 57c5b27cd27a9236ce20768e8de4acd9bad6ed4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 17:06:22 +0200 Subject: [PATCH 08/11] set spring.cloud.gateway.mvc.enabled=false for non-gateway component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- api-catalog-services/src/main/resources/application.yml | 1 + caching-service/src/main/resources/application.yml | 1 + discovery-service/src/main/resources/application.yml | 1 + zaas-service/src/main/resources/application.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/api-catalog-services/src/main/resources/application.yml b/api-catalog-services/src/main/resources/application.yml index 426d8077f4..58a7af7337 100644 --- a/api-catalog-services/src/main/resources/application.yml +++ b/api-catalog-services/src/main/resources/application.yml @@ -7,6 +7,7 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} + gateway.mvc.enabled: false mvc: throw-exception-if-no-handler-found: true output: diff --git a/caching-service/src/main/resources/application.yml b/caching-service/src/main/resources/application.yml index 0e2f51cbde..decb083f66 100644 --- a/caching-service/src/main/resources/application.yml +++ b/caching-service/src/main/resources/application.yml @@ -110,6 +110,7 @@ spring: cloud: compatibilityVerifier: enabled: false # Should be removed when upgrade to Spring Cloud 3.x + gateway.mvc.enabled: false application: name: Caching service mvc: diff --git a/discovery-service/src/main/resources/application.yml b/discovery-service/src/main/resources/application.yml index 3d817c5ffa..7afcada586 100644 --- a/discovery-service/src/main/resources/application.yml +++ b/discovery-service/src/main/resources/application.yml @@ -49,6 +49,7 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} + gateway.mvc.enabled: false output: ansi: enabled: detect diff --git a/zaas-service/src/main/resources/application.yml b/zaas-service/src/main/resources/application.yml index 2b7e5d3a40..1385a4edc4 100644 --- a/zaas-service/src/main/resources/application.yml +++ b/zaas-service/src/main/resources/application.yml @@ -101,6 +101,7 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} + gateway.mvc.enabled: false mvc: throw-exception-if-no-handler-found: false # to suppress NoHandlerFoundException: No handler found for GET /error, we already provide error handling for requests log-resolved-exception: false # Suppress useless logs from AbstractHandlerExceptionResolver From 85890948510a559a3aba49f6c58eb554e91c3fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Tue, 1 Oct 2024 17:29:02 +0200 Subject: [PATCH 09/11] attempt to set spring.cloud.gateway.enabled to false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- api-catalog-services/src/main/resources/application.yml | 4 +++- caching-service/src/main/resources/application.yml | 4 +++- discovery-service/src/main/resources/application.yml | 4 +++- zaas-service/src/main/resources/application.yml | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/api-catalog-services/src/main/resources/application.yml b/api-catalog-services/src/main/resources/application.yml index 58a7af7337..870fcfbda6 100644 --- a/api-catalog-services/src/main/resources/application.yml +++ b/api-catalog-services/src/main/resources/application.yml @@ -7,7 +7,9 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} - gateway.mvc.enabled: false + gateway: + mvc.enabled: false + enabled: false mvc: throw-exception-if-no-handler-found: true output: diff --git a/caching-service/src/main/resources/application.yml b/caching-service/src/main/resources/application.yml index decb083f66..e8fd57aa74 100644 --- a/caching-service/src/main/resources/application.yml +++ b/caching-service/src/main/resources/application.yml @@ -110,7 +110,9 @@ spring: cloud: compatibilityVerifier: enabled: false # Should be removed when upgrade to Spring Cloud 3.x - gateway.mvc.enabled: false + gateway: + mvc.enabled: false + enabled: false application: name: Caching service mvc: diff --git a/discovery-service/src/main/resources/application.yml b/discovery-service/src/main/resources/application.yml index 7afcada586..21222b4332 100644 --- a/discovery-service/src/main/resources/application.yml +++ b/discovery-service/src/main/resources/application.yml @@ -49,7 +49,9 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} - gateway.mvc.enabled: false + gateway: + mvc.enabled: false + enabled: false output: ansi: enabled: detect diff --git a/zaas-service/src/main/resources/application.yml b/zaas-service/src/main/resources/application.yml index 1385a4edc4..6383df8bf0 100644 --- a/zaas-service/src/main/resources/application.yml +++ b/zaas-service/src/main/resources/application.yml @@ -101,7 +101,9 @@ spring: client: hostname: ${apiml.service.hostname} ipAddress: ${apiml.service.ipAddress} - gateway.mvc.enabled: false + gateway: + mvc.enabled: false + enabled: false mvc: throw-exception-if-no-handler-found: false # to suppress NoHandlerFoundException: No handler found for GET /error, we already provide error handling for requests log-resolved-exception: false # Suppress useless logs from AbstractHandlerExceptionResolver From 947a0317d8d56ae539a6ad48f53ae4f0102c9055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Wed, 2 Oct 2024 09:26:23 +0200 Subject: [PATCH 10/11] remove commons-logging from the services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index 5e33593266..f68f81fe00 100644 --- a/build.gradle +++ b/build.gradle @@ -97,6 +97,22 @@ allprojects { } +configure(subprojects.findAll { it.name in [ + 'apiml-common-lib-package', + 'api-catalog-services', + 'caching-service', + 'discovery-service', + 'gateway-service', + 'zaas-service' +]}) { + + configurations.all { + // it has been replaced by spring-jcl + exclude group: "commons-logging", module: "commons-logging" + } + +} + configure(subprojects.findAll {it.name != 'platform'}) { apply plugin: 'java-library' From 9956a251a9be87a013afd6332ad533ab9fe20cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jare=C5=A1?= Date: Wed, 2 Oct 2024 10:31:50 +0200 Subject: [PATCH 11/11] code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Jareš --- gateway-package/src/main/resources/bin/start.sh | 16 ++++++++-------- zaas-package/src/main/resources/bin/start.sh | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gateway-package/src/main/resources/bin/start.sh b/gateway-package/src/main/resources/bin/start.sh index 4045b56c16..9a52a3f287 100755 --- a/gateway-package/src/main/resources/bin/start.sh +++ b/gateway-package/src/main/resources/bin/start.sh @@ -137,6 +137,14 @@ else GATEWAY_LOADER_PATH=${COMMON_LIB} fi +# Check if the directory containing the ZAAS shared JARs was set and append it to the ZAAS loader path +if [ -n "${ZWE_GATEWAY_SHARED_LIBS}" ] +then + GATEWAY_LOADER_PATH=${ZWE_GATEWAY_SHARED_LIBS},${GATEWAY_LOADER_PATH} +fi + +echo "Setting loader path: "${GATEWAY_LOADER_PATH} + ATTLS_ENABLED="false" # ZWE_configs_spring_profiles_active for back compatibility, should be removed in v3 - enabling via Spring profile if [ "${ZWE_zowe_network_server_tls_attls}" = "true" -o "$(echo ${ZWE_configs_spring_profiles_active:-} | awk '/^(.*,)?attls(,.*)?$/')" ]; then @@ -163,14 +171,6 @@ else externalProtocol="http" fi -# Check if the directory containing the ZAAS shared JARs was set and append it to the ZAAS loader path -if [ -n "${ZWE_GATEWAY_SHARED_LIBS}" ] -then - GATEWAY_LOADER_PATH=${ZWE_GATEWAY_SHARED_LIBS} -fi - -echo "Setting loader path: "${GATEWAY_LOADER_PATH} - LIBPATH="$LIBPATH":"/lib" LIBPATH="$LIBPATH":"/usr/lib" LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin diff --git a/zaas-package/src/main/resources/bin/start.sh b/zaas-package/src/main/resources/bin/start.sh index a0a0485f20..82c685dc8c 100755 --- a/zaas-package/src/main/resources/bin/start.sh +++ b/zaas-package/src/main/resources/bin/start.sh @@ -138,6 +138,14 @@ else ZAAS_LOADER_PATH=${COMMON_LIB} fi +# Check if the directory containing the ZAAS shared JARs was set and append it to the ZAAS loader path +if [ -n "${ZWE_ZAAS_SHARED_LIBS}" ] +then + ZAAS_LOADER_PATH=${ZWE_ZAAS_SHARED_LIBS},${ZAAS_LOADER_PATH} +fi + +echo "Setting loader path: "${ZAAS_LOADER_PATH} + ATTLS_ENABLED="false" # ZWE_configs_spring_profiles_active for back compatibility, should be removed in v3 - enabling via Spring profile if [ "${ZWE_zowe_network_server_tls_attls}" = "true" -o "$(echo ${ZWE_configs_spring_profiles_active:-} | awk '/^(.*,)?attls(,.*)?$/')" ]; then @@ -163,14 +171,6 @@ else externalProtocol="http" fi -# Check if the directory containing the ZAAS shared JARs was set and append it to the ZAAS loader path -if [ -n "${ZWE_ZAAS_SHARED_LIBS}" ] -then - ZAAS_LOADER_PATH=${ZWE_ZAAS_SHARED_LIBS},${ZAAS_LOADER_PATH} -fi - -echo "Setting loader path: "${ZAAS_LOADER_PATH} - LIBPATH="$LIBPATH":"/lib" LIBPATH="$LIBPATH":"/usr/lib" LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin