From 752f2efd1511410cd25dd5d6a3131794db216c53 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Sat, 19 Oct 2024 09:48:47 +0530 Subject: [PATCH 1/3] Migrate to Java 21 --- .../workflows/build-timestamped-master.yml | 2 +- .../workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- README.md | 2 +- ballerina/Ballerina.toml | 18 +++---- ballerina/Dependencies.toml | 43 +++++++-------- build-config/resources/Ballerina.toml | 12 ++--- gradle.properties | 42 +++++++-------- native/build.gradle | 7 ++- .../ballerina/lib/soap/ExecutionCallback.java | 45 ---------------- .../main/java/io/ballerina/lib/soap/Soap.java | 52 +++++++++---------- .../main/java/org/wssec/DocumentBuilder.java | 5 +- spotbugs-exclude.xml | 2 +- 16 files changed, 98 insertions(+), 142 deletions(-) delete mode 100644 native/src/main/java/io/ballerina/lib/soap/ExecutionCallback.java diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index c8e42fa..86da481 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -12,5 +12,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 9b1ae23..257fc9a 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 11922b5..ebe213e 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 014490f..812c09a 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 secrets: inherit with: package-name: soap diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ce4ca29..40f44bd 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,5 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 458aab5..d91a5f3 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 secrets: inherit diff --git a/README.md b/README.md index 7cd54ae..f4bf0b8 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ This repository contains only the source code of the package. ### Set up the prerequisites -1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations). +1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations). - [Oracle](https://www.oracle.com/java/technologies/downloads/) - [OpenJDK](https://adoptium.net/) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 9acd016..be31339 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,40 +1,40 @@ [package] org = "ballerina" name = "soap" -version = "2.0.0" +version = "2.0.1" authors = ["Ballerina"] export=["soap", "soap.soap11", "soap.soap12"] keywords = ["soap"] repository = "https://github.com/ballerina-platform/module-ballerina-soap" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.10.0-20241011-161100-51978649" [build-options] observabilityIncluded = true -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "soap-native" -version = "2.0.0" -path = "../native/build/libs/soap-native-2.0.0.jar" +version = "2.0.1" +path = "../native/build/libs/soap-native-2.0.1-SNAPSHOT.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.wss4j" artifactId = "wss4j-ws-security-dom" version = "3.0.1" path = "./lib/wss4j-ws-security-dom-3.0.1.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.wss4j" artifactId = "wss4j-ws-security-common" version = "3.0.1" path = "./lib/wss4j-ws-security-common-3.0.1.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.santuario" artifactId = "xmlsec" version = "3.0.3" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 127be5b..b5a1a75 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.10.0-20241011-161100-51978649" [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -22,18 +22,17 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,7 +40,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.7.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -53,7 +52,7 @@ modules = [ [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -64,7 +63,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -96,7 +95,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.6.2" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -116,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.13.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -124,8 +123,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -216,7 +214,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -227,7 +225,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -241,20 +239,19 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.3.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -262,7 +259,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -271,7 +268,7 @@ dependencies = [ [[package]] org = "ballerina" name = "soap" -version = "2.0.0" +version = "2.0.1" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, @@ -292,7 +289,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -314,7 +311,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -322,7 +319,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.4.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index b55c963..fefcaad 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -8,33 +8,33 @@ keywords = ["soap"] repository = "https://github.com/ballerina-platform/module-ballerina-soap" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.10.0-20241011-161100-51978649" [build-options] observabilityIncluded = true -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "soap-native" version = "@toml.version@" path = "../native/build/libs/soap-native-@project.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.wss4j" artifactId = "wss4j-ws-security-dom" version = "@wssecuritydom.version@" path = "./lib/wss4j-ws-security-dom-@wssecuritydom.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.wss4j" artifactId = "wss4j-ws-security-common" version = "@wssecuritycommon.version@" path = "./lib/wss4j-ws-security-common-@wssecuritycommon.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.apache.santuario" artifactId = "xmlsec" version = "@xmlsec.version@" diff --git a/gradle.properties b/gradle.properties index eed1b8b..9138043 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,35 +3,35 @@ group=io.ballerina.stdlib version=2.0.1-SNAPSHOT checkstylePluginVersion=10.12.0 -spotbugsPluginVersion=5.0.14 +spotbugsPluginVersion=6.0.18 shadowJarPluginVersion=8.1.1 downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.2.4 -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.10.0-20241011-161100-51978649 -stdlibIoVersion=1.6.1 -stdlibTimeVersion=2.4.0 -stdlibUrlVersion=2.4.0 +stdlibIoVersion=1.6.2-20240928-084100-656404f +stdlibTimeVersion=2.5.1-20240930-120200-e59222b +stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 -stdlibConstraintVersion=1.5.0 -stdlibCryptoVersion=2.7.2 -stdlibLogVersion=2.10.0 -stdlibOsVersion=1.8.0 -stdlibRandomVersion=1.5.0 -stdlibTaskVersion=2.5.0 +stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 +stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab +stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 +stdlibOsVersion=1.8.1-20241001-120600-dd1626e +stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e +stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 -stdlibCacheVersion=3.8.0 -stdlibFileVersion=1.10.0 -stdlibMimeVersion=2.10.0 -stdlibUuidVersion=1.8.0 +stdlibCacheVersion=3.8.1-20241007-154900-63f4403 +stdlibFileVersion=1.10.1-20241007-160900-03f7b64 +stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 +stdlibUuidVersion=1.8.1-20241009-134600-a05012b -stdlibAuthVersion=2.12.0 -stdlibJwtVersion=2.13.0 -stdlibOAuth2Version=2.12.0 +stdlibAuthVersion=2.12.1-20241010-130800-733dbef +stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 +stdlibOAuth2Version=2.12.1-20241010-123600-0e0cfcc -stdlibHttpVersion=2.12.0 +stdlibHttpVersion=2.12.1-20241018-081800-bb91312 wsSecurityDomVersion=3.0.1 wsSecurityCommonVersion=3.0.1 @@ -39,5 +39,5 @@ xmlSecVersion=3.0.3 guavaVersion=32.1.1-jre # Ballerinax Observer -observeVersion=1.3.0 -observeInternalVersion=1.3.0 +observeVersion=1.3.1-20241007-161000-645452d +observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 diff --git a/native/build.gradle b/native/build.gradle index 59e48b9..cccfcf3 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -44,8 +44,11 @@ checkstyle { checkstyleMain.dependsOn(":checkstyle:downloadCheckstyleRuleFiles") spotbugsMain { - effort "max" - reportLevel "low" + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW reportsDir = file("$project.buildDir/reports/spotbugs") reports { html.enabled true diff --git a/native/src/main/java/io/ballerina/lib/soap/ExecutionCallback.java b/native/src/main/java/io/ballerina/lib/soap/ExecutionCallback.java deleted file mode 100644 index 4f17f34..0000000 --- a/native/src/main/java/io/ballerina/lib/soap/ExecutionCallback.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com) All Rights Reserved. -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package io.ballerina.lib.soap; - -import io.ballerina.runtime.api.Future; -import io.ballerina.runtime.api.async.Callback; -import io.ballerina.runtime.api.values.BError; - -/** - * Callback class for executing Ballerina dependently type methods. - */ -public class ExecutionCallback implements Callback { - private final Future future; - - ExecutionCallback(Future future) { - this.future = future; - } - @Override - public void notifySuccess(Object o) { - this.future.complete(o); - } - - @Override - public void notifyFailure(BError bError) { - bError.printStackTrace(); - // Service level `panic` is captured in this method. - // Since, `panic` is due to a critical application bug or resource exhaustion we need to exit the application. - // Please refer: https://github.com/ballerina-platform/ballerina-standard-library/issues/2714 - System.exit(1); - } -} diff --git a/native/src/main/java/io/ballerina/lib/soap/Soap.java b/native/src/main/java/io/ballerina/lib/soap/Soap.java index eb76da0..a7526cf 100644 --- a/native/src/main/java/io/ballerina/lib/soap/Soap.java +++ b/native/src/main/java/io/ballerina/lib/soap/Soap.java @@ -17,47 +17,47 @@ package io.ballerina.lib.soap; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.async.StrandMetadata; -import io.ballerina.runtime.api.creators.TypeCreator; -import io.ballerina.runtime.api.types.UnionType; +import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BObject; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; -import static org.wssec.ModuleUtils.getModule; - public class Soap { private static final String REMOTE_FUNCTION = "generateResponse"; - public static final StrandMetadata REMOTE_EXECUTION_STRAND = new StrandMetadata( - getModule().getOrg(), - getModule().getName(), - getModule().getMajorVersion(), - REMOTE_FUNCTION); public static Object sendReceive11(Environment env, BObject soap11, Object body, BString action, BMap headers, BString path, BTypedesc typeDesc) { - Future future = env.markAsync(); - ExecutionCallback executionCallback = new ExecutionCallback(future); - UnionType typeUnion = TypeCreator.createUnionType(PredefinedTypes.TYPE_XML, PredefinedTypes.TYPE_ANYDATA_ARRAY, - PredefinedTypes.TYPE_ERROR); - Object[] arguments = new Object[]{body, true, action, true, headers, true, path, true}; - env.getRuntime().invokeMethodAsyncConcurrently(soap11, REMOTE_FUNCTION, null, REMOTE_EXECUTION_STRAND, - executionCallback, null, typeUnion, arguments); + env.yieldAndRun(() -> { + try { + Object[] arguments = new Object[]{body, action, headers, path}; + Object result = env.getRuntime().call(soap11, REMOTE_FUNCTION, arguments); + if (result instanceof BError) { + ((BError) result).printStackTrace(); + System.exit(1); + + } + } catch (BError bError) { + bError.printStackTrace(); + System.exit(1); + } + return null; + }); return null; } public static Object sendReceive12(Environment env, BObject soap12, Object body, Object action, BMap headers, BString path, BTypedesc typeDesc) { - Future future = env.markAsync(); - ExecutionCallback executionCallback = new ExecutionCallback(future); - UnionType typeUnion = TypeCreator.createUnionType(PredefinedTypes.TYPE_XML, PredefinedTypes.TYPE_ANYDATA_ARRAY, - PredefinedTypes.TYPE_ERROR); - Object[] arguments = new Object[]{body, true, action, true, headers, true, path, true}; - env.getRuntime().invokeMethodAsyncConcurrently(soap12, REMOTE_FUNCTION, null, REMOTE_EXECUTION_STRAND, - executionCallback, null, typeUnion, arguments); + env.yieldAndRun(() -> { + try { + Object[] arguments = new Object[]{body, action, headers, path}; + env.getRuntime().call(soap12, REMOTE_FUNCTION, arguments); + } catch (BError bError) { + bError.printStackTrace(); + System.exit(1); + } + return null; + }); return null; } } diff --git a/native/src/main/java/org/wssec/DocumentBuilder.java b/native/src/main/java/org/wssec/DocumentBuilder.java index 6ef986b..35a41d7 100644 --- a/native/src/main/java/org/wssec/DocumentBuilder.java +++ b/native/src/main/java/org/wssec/DocumentBuilder.java @@ -31,13 +31,14 @@ import static org.wssec.Utils.createError; import static org.wssec.WsSecurityUtils.convertDocumentToString; -public class DocumentBuilder { +public final class DocumentBuilder { private final Document document; public DocumentBuilder(BObject documentBuilder, BXml xmlPayload) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); - this.document = factory.newDocumentBuilder().parse(new InputSource(new StringReader(xmlPayload.toString()))); + this.document = factory.newDocumentBuilder().parse(new InputSource( + new StringReader(xmlPayload.toString()))); documentBuilder.addNativeData(NATIVE_DOCUMENT, this.document); } diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index e22fda1..3af7dd8 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -17,7 +17,7 @@ --> - + From 267d6c5f1840c2ff60ed846d1794057effb2b541 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Thu, 14 Nov 2024 21:14:26 +0530 Subject: [PATCH 2/3] Migrate to new Runtime APIs --- ballerina/Ballerina.toml | 8 ++-- ballerina/Dependencies.toml | 31 ++++++++++---- build-config/resources/Ballerina.toml | 2 +- gradle.properties | 42 +++++++++---------- .../main/java/io/ballerina/lib/soap/Soap.java | 13 +++--- 5 files changed, 53 insertions(+), 43 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 2cbdec0..5e13cb0 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,14 +1,14 @@ [package] org = "ballerina" name = "soap" -version = "2.0.1" +version = "2.1.0" authors = ["Ballerina"] export=["soap", "soap.soap11", "soap.soap12"] keywords = ["soap"] repository = "https://github.com/ballerina-platform/module-ballerina-soap" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0-20241011-161100-51978649" +distribution = "2201.11.0-20241112-214900-6b80ab87" [build-options] observabilityIncluded = true @@ -19,8 +19,8 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "soap-native" -version = "2.0.1" -path = "../native/build/libs/soap-native-2.0.1.jar" +version = "2.1.0" +path = "../native/build/libs/soap-native-2.1.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "org.apache.wss4j" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index b5a1a75..09db1b2 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0-20241011-161100-51978649" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" @@ -26,13 +26,14 @@ version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"} + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -49,6 +50,15 @@ modules = [ {org = "ballerina", packageName = "crypto", moduleName = "crypto"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -63,12 +73,13 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -123,7 +134,8 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} ] [[package]] @@ -225,7 +237,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -245,13 +257,14 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.1" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -268,7 +281,7 @@ dependencies = [ [[package]] org = "ballerina" name = "soap" -version = "2.0.1" +version = "2.1.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, @@ -311,7 +324,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index d30bca5..174eae7 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -8,7 +8,7 @@ keywords = ["soap"] repository = "https://github.com/ballerina-platform/module-ballerina-soap" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.11.0" +distribution = "2201.11.0-20241112-214900-6b80ab87" [build-options] observabilityIncluded = true diff --git a/gradle.properties b/gradle.properties index 4a9a4fd..1962954 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,30 +9,30 @@ downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.2.4 -ballerinaLangVersion=2201.11.0-20241008-112400-81975006 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 -stdlibIoVersion=1.6.2-20240928-084100-656404f -stdlibTimeVersion=2.5.1-20240930-120200-e59222b -stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibTimeVersion=2.6.0-20241113-073800-201b904 +stdlibUrlVersion=2.4.1-20241113-073900-335ff51 -stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 -stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab -stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 -stdlibOsVersion=1.8.1-20241001-120600-dd1626e -stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e -stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 +stdlibCryptoVersion=2.7.3-20241113-081400-d015a39 +stdlibLogVersion=2.10.1-20241113-120000-4577868 +stdlibOsVersion=1.8.1-20241113-122000-cca973b +stdlibRandomVersion=1.5.1-20241113-122300-1bc770e +stdlibTaskVersion=2.5.1-20241113-123500-f905281 -stdlibCacheVersion=3.8.1-20241007-154900-63f4403 -stdlibFileVersion=1.10.1-20241007-160900-03f7b64 -stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 -stdlibUuidVersion=1.8.1-20241009-134600-a05012b +stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf +stdlibFileVersion=1.10.1-20241113-151700-e1a2e38 +stdlibMimeVersion=2.10.2-20241113-154200-d953747 +stdlibUuidVersion=1.8.1-20241113-154400-443c67b -stdlibAuthVersion=2.12.1-20241010-130800-733dbef -stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f -stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 -stdlibOAuth2Version=2.12.1-20241010-123600-0e0cfcc +stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibDataJsonDataVersion=0.3.0-20241113-163100-6d332e1 +stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa +stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe -stdlibHttpVersion=2.13.0-20241106-120000-d375c3b +stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a wsSecurityDomVersion=3.0.1 wsSecurityCommonVersion=3.0.1 @@ -40,5 +40,5 @@ xmlSecVersion=3.0.3 guavaVersion=32.1.1-jre # Ballerinax Observer -observeVersion=1.3.1-20241007-161000-645452d -observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 +observeVersion=1.4.0-20241113-092000-b83ae74 +observeInternalVersion=1.3.1-20241113-101700-265054d diff --git a/native/src/main/java/io/ballerina/lib/soap/Soap.java b/native/src/main/java/io/ballerina/lib/soap/Soap.java index a7526cf..fd3ba02 100644 --- a/native/src/main/java/io/ballerina/lib/soap/Soap.java +++ b/native/src/main/java/io/ballerina/lib/soap/Soap.java @@ -28,36 +28,33 @@ public class Soap { public static Object sendReceive11(Environment env, BObject soap11, Object body, BString action, BMap headers, BString path, BTypedesc typeDesc) { - env.yieldAndRun(() -> { + return env.yieldAndRun(() -> { try { Object[] arguments = new Object[]{body, action, headers, path}; - Object result = env.getRuntime().call(soap11, REMOTE_FUNCTION, arguments); + Object result = env.getRuntime().callMethod(soap11, REMOTE_FUNCTION, null, arguments); if (result instanceof BError) { ((BError) result).printStackTrace(); - System.exit(1); - } + return result; } catch (BError bError) { bError.printStackTrace(); System.exit(1); } return null; }); - return null; } public static Object sendReceive12(Environment env, BObject soap12, Object body, Object action, BMap headers, BString path, BTypedesc typeDesc) { - env.yieldAndRun(() -> { + return env.yieldAndRun(() -> { try { Object[] arguments = new Object[]{body, action, headers, path}; - env.getRuntime().call(soap12, REMOTE_FUNCTION, arguments); + return env.getRuntime().callMethod(soap12, REMOTE_FUNCTION, null, arguments); } catch (BError bError) { bError.printStackTrace(); System.exit(1); } return null; }); - return null; } } From c6719bab2b2a2301d4bfd7e48986386a70811293 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Mon, 18 Nov 2024 11:33:32 +0530 Subject: [PATCH 3/3] Use main branch for github actions --- .github/workflows/build-timestamped-master.yml | 2 +- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index 86da481..c8e42fa 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -12,5 +12,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 257fc9a..9b1ae23 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index ebe213e..11922b5 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 812c09a..014490f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main secrets: inherit with: package-name: soap diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 40f44bd..ce4ca29 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,5 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index d91a5f3..458aab5 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main secrets: inherit