You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2024/11/18 13:15:47 UTC
(cxf) branch 3.5.x-fixes updated (a9683e05e8 -> bff380a4e6)
This is an automated email from the ASF dual-hosted git repository.
reta pushed a change to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
from a9683e05e8 Fix possible IllegalStateException when bundle is stopped (#2144)
new 331d1137cf Bump org.codehaus.mojo:exec-maven-plugin from 3.4.1 to 3.5.0 (#2143)
new 23a430500a Bump github/codeql-action from 3.27.0 to 3.27.1 (#2142)
new e86f75afbd Bump org.webjars:swagger-ui from 5.18.1 to 5.18.2 (#2146)
new 2a613df121 Update Netty to 4.1.115.Final and Netty Tcnative to 2.0.69.Final
new e041a0fd27 Fix flakiness in org.apache.cxf.io.DelayedCachedOutputStreamCleanerTest.testCleanOnShutdown test case
new 44fa0a5e57 CXF-9076: Exception message is not unmarshalled with JDK17+ (limit the fix to JDK standard library exceptions) (#2148)
new 417737daee Recording .gitmergeinfo Changes
new bff380a4e6 Fix compilation issue (post cherrypicking)
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/codeql-analysis.yml | 4 +-
.gitmergeinfo | 9 ++++
.../cxf/interceptor/ClientFaultConverter.java | 54 +++++++++++++++-------
.../io/DelayedCachedOutputStreamCleanerTest.java | 8 ++--
distribution/src/main/release/samples/pom.xml | 6 +--
parent/pom.xml | 6 +--
.../systest/jaxws/ClientServerExceptionServer.java | 5 ++
.../systest/jaxws/ClientServerExceptionTest.java | 20 ++++++--
.../apache/cxf/systest/jaxws/ExceptionService.java | 1 +
.../org/apache/cxf/systest/jaxws/SayException.java | 20 ++++----
10 files changed, 92 insertions(+), 41 deletions(-)
copy tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/exception/SuperException.java => systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SayException.java (74%)
(cxf) 04/08: Update Netty to 4.1.115.Final and Netty Tcnative to 2.0.69.Final
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 2a613df121ee4158a85d6e1ab3449b6429c382cd
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Thu Nov 14 13:26:13 2024 -0500
Update Netty to 4.1.115.Final and Netty Tcnative to 2.0.69.Final
(cherry picked from commit ce13e155bcdf28611177a35f4d29e4967cc07828)
# Conflicts:
# distribution/src/main/release/samples/pom.xml
(cherry picked from commit 01e087970402d284e217ce1be674a00eab774c70)
# Conflicts:
# distribution/src/main/release/samples/pom.xml
(cherry picked from commit cad9e5a68ca32bc123de17d0b64419a2ba935ee5)
# Conflicts:
# distribution/src/main/release/samples/pom.xml
---
distribution/src/main/release/samples/pom.xml | 2 +-
parent/pom.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index 665585b90d..c62bcb8031 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -33,7 +33,7 @@
<cxf.spring.boot.version>2.6.15</cxf.spring.boot.version>
<cxf.spring.cloud.eureka.version>3.1.7</cxf.spring.cloud.eureka.version>
<cxf.jetty9.version>9.4.56.v20240826</cxf.jetty9.version>
- <cxf.netty.version>4.1.114.Final</cxf.netty.version>
+ <cxf.netty.version>4.1.115.Final</cxf.netty.version>
<cxf.httpcomponents.client.version>4.5.14</cxf.httpcomponents.client.version>
<cxf.swagger.ui.version>5.18.2</cxf.swagger.ui.version>
<cxf.tika.version>2.9.1</cxf.tika.version>
diff --git a/parent/pom.xml b/parent/pom.xml
index 1ff762e218..b15fbc0de7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -180,8 +180,8 @@
<cxf.msv.version>2022.7</cxf.msv.version>
<cxf.neethi.version>3.2.1</cxf.neethi.version>
<cxf.netty.version.range>[4,5)</cxf.netty.version.range>
- <cxf.netty.version>4.1.114.Final</cxf.netty.version>
- <cxf.netty.tcnative.version>2.0.46.Final</cxf.netty.tcnative.version>
+ <cxf.netty.version>4.1.115.Final</cxf.netty.version>
+ <cxf.netty.tcnative.version>2.0.69.Final</cxf.netty.tcnative.version>
<cxf.olingo.version>2.0.12</cxf.olingo.version>
<cxf.openjpa.version>3.2.2</cxf.openjpa.version>
<cxf.opensaml.osgi.version.range>[3.1,4)</cxf.opensaml.osgi.version.range>
(cxf) 05/08: Fix flakiness in org.apache.cxf.io.DelayedCachedOutputStreamCleanerTest.testCleanOnShutdown test case
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit e041a0fd2723d35e5409af1292b59d3554f1914d
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sat Nov 16 12:22:57 2024 -0500
Fix flakiness in org.apache.cxf.io.DelayedCachedOutputStreamCleanerTest.testCleanOnShutdown test case
(cherry picked from commit 3ff5a8f32a51f1de48bb3c5e724db68dae66a68a)
(cherry picked from commit fe76857bdfa7d2dd39345b1f1e1aa73dea652de6)
(cherry picked from commit 6ebc2c794349f2154908b4a781b166e1494dc091)
---
.../org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java b/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java
index 8fcb12cf46..1cd557c1c6 100644
--- a/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java
+++ b/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java
@@ -147,14 +147,13 @@ public class DelayedCachedOutputStreamCleanerTest {
@Test
public void testCleanOnShutdown() throws InterruptedException {
- /* Delay of 2.5 seconds */
- final Map<String, Object> properties = Collections.singletonMap(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500);
+ /* Delay of 5 seconds */
+ final Map<String, Object> properties = Collections.singletonMap(CachedConstants.CLEANER_DELAY_BUS_PROP, 5000);
bus = new ExtensionManagerBus(new HashMap<>(), properties);
final AtomicBoolean latch = new AtomicBoolean();
final Closeable closeable = () -> latch.compareAndSet(false, true);
- bus.setProperty(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */
final CachedOutputStreamCleaner cleaner = bus.getExtension(CachedOutputStreamCleaner.class);
cleaner.register(closeable);
@@ -169,14 +168,13 @@ public class DelayedCachedOutputStreamCleanerTest {
public void testCleanOnShutdownDisabled() throws InterruptedException {
/* Delay of 2.5 seconds */
final Map<String, Object> properties = new HashMap<>();
- properties.put(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500);
+ properties.put(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */
properties.put(CachedConstants.CLEANER_CLEAN_ON_SHUTDOWN_BUS_PROP, false);
bus = new ExtensionManagerBus(new HashMap<>(), properties);
final AtomicBoolean latch = new AtomicBoolean();
final Closeable closeable = () -> latch.compareAndSet(false, true);
- bus.setProperty(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */
final CachedOutputStreamCleaner cleaner = bus.getExtension(CachedOutputStreamCleaner.class);
cleaner.register(closeable);
(cxf) 02/08: Bump github/codeql-action from 3.27.0 to 3.27.1 (#2142)
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 23a430500a06ceb53684aab8e555c6be3493234d
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Mon Nov 11 15:58:34 2024 -0500
Bump github/codeql-action from 3.27.0 to 3.27.1 (#2142)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/662472033e021d55d94146f66f6058822b0b39fd...4f3212b61783c3c68e8309a0f18a699764811cda)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <su...@github.com>
Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
(cherry picked from commit 768d1f97700eb3f217deaf326f0ae1b4acfb32f7)
# Conflicts:
# .github/workflows/scorecards.yml
(cherry picked from commit b751ff2f7597f27a4ec7668eb01088e0cd3000cb)
(cherry picked from commit 1695a6d5dcf4444c5861c408444cc18bd46ac2b9)
---
.github/workflows/codeql-analysis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 5d0ed99d99..769af848b9 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -54,7 +54,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
+ uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
with:
languages: ${{ matrix.language }}
#config-file: ./.github/codeql/codeql-cxf-config.yml
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
+ uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
(cxf) 07/08: Recording .gitmergeinfo Changes
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 417737daee9d611cb4dfb5b937f36c02b0ca3d61
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Mon Nov 18 07:52:44 2024 -0500
Recording .gitmergeinfo Changes
---
.gitmergeinfo | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.gitmergeinfo b/.gitmergeinfo
index d4f14b8e9e..7fb2ed6cdf 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -229,9 +229,11 @@ B 703fdc183a1f204a7fce982f468a7c8f0de65d80
B 7088262b8332b3834a97fc176076ac501a38a72d
B 7157608c785cc378a1a5226f5bcc20faec9ec8a0
B 718f5a602a932e58d2528a913b3d4b62e5990e3d
+B 71cffa3de0d6b2aff64e676b19a28df2e3bc3ddc
B 740c1aaad57a59ba66a9a2147d8be1737b924aa0
B 74b205c590e08ad68546f102ca317fd3fe76e47f
B 752fbd67181d7ae2bf68a632857e5c2f7c6dec6f
+B 75940c03a69331800b9fc614d866c548da77dd77
B 75adf4aa92c76f9cf5ecc61a5ea40e31e446e704
B 75d4379352ab441051bb3556490623d42a6ecf03
B 76e3c86ac68eef73680cbe62c614289f179c34b9
@@ -486,6 +488,7 @@ B e7d101b0654337d5e55de521af679bcb5526ab30
B e7d5bca0ba38b0f282f9da7f87bf964544b6b66a
B e84213beeb7fd77277534ecb6e15d792063ac609
B e8ee24fd6108ffde275b9a474765d3cd1b6c7535
+B e933c193f11c969ad622e1cb82936fdf5b004014
B e9ca1a75d8f232b2cea6c3c6b375bb6222cb0461
B ea0212e271a1df063cba57b80d658d78efe5eb1f
B eb54ef785deb4d58def825feb9852ebe68b6b5b8
@@ -493,6 +496,7 @@ B eba0b1be2f33b250956beab6bd4a371f6c55fb05
B ebafb13096e9b9126894ef1e927dbe143976d3ab
B ee814f4de36be5c0ba72de24ae41ecdf32efdbb7
B eeed584b8134dad9ca9ddb059f54c360b7005794
+B ef25a61fb724d3bdecfcb505a9125b1c9f2d86cb
B ef369f2efd144ac4fec2fac43e1805a794e777a6
B efb0e9d280837a2ff308b2e15c07f40dcd32473f
B efb861810246c780402ed0d7ed23f057f20dbb63
@@ -527,6 +531,7 @@ M 00b6fe804da2cdff8a1641e9aa20c6cab713fef6
M 01cf70330332480c5c29c8c3d715503f83253bac
M 0203ba6ede0b5aa3785c950598a25feccd62df6f
M 024240b5a6157dc632c346f79ee0ba8149112ff8
+M 029418b6d91a7fc145fc39fc6e816072408e7252
M 02be25361d4f90485cebcd32ce41df8aa4249cbb
M 032e12e2e934ee193b7028fa5640898045bcb15f
M 039ef658541017e2b8ddeaa0f49d771564e7d1f2
@@ -652,6 +657,7 @@ M 36453932d815079572cd5d9ff14eec328bf49786
M 365140d8fe479b7a0fef408c2c09e9de91349bb2
M 3661a77398be2845b4899d5474ae87eb6e18f5d7
M 36a723bfcba96e52e12f5c9c40028859db4be904
+M 36f02fa18c67610bee52f6e399c23f31747b799d
M 36ff8fb71844770e8116c29201d5a06349a3aa6f
M 37e7e5cd36a0c70a49aac707dc47f75dc38695f6
M 384cc25e9a7c7db55b24452f5825d576fbb8563e
@@ -791,6 +797,7 @@ M 656c9459ae97e56039a77e581122e56699ea2127
M 658738f5a8fe85057a6d48ca4f3a49b172b1f9e4
M 659a083f2ff7e20df40f4e92e3aa2fed93b54ffc
M 659d9d10e2901e6fa6310a159b7fe01d0d572baa
+M 65a0ec862f6d216a1da91ea3f53472aa72b9489e
M 65fd67d7e3d9ad8ed211c1fdeca91c4e75d81149
M 6618c5404b2a84ae9e40180dffbf90061026dc62
M 669556b088217e00466c95938a3cac4a58c86eba
@@ -1009,6 +1016,7 @@ M ba34800cb3432e310d9fb5f9165619baa55c8bec
M ba58c444dd835e105136b9eab74e5c0e9e80914b
M bb048f3554f56ac31b139ff79984f0c332abd148
M bb15f8ee41abb6d9ece7811b2405a11e433f19b5
+M bb1a4ab523c9b43fd2637612012498e73e584596
M bb21d5713aea5eb033e881b61b565d36e3b93f2f
M bb6497e817be64fb94201a0920e2e42ca56463fa
M bb69a97ff9b429e2d02c1883c22b793fd5b29197
@@ -1058,6 +1066,7 @@ M ca4753067f489ce45a300ad7e462883a8dc377b7
M ca648669c438c08da251b1bdc176a53dda555738
M ca7707f3638e2c99fc33173e022badf95206564b
M ca7b6d8daff836949e95f41ef825155d66e512e2
+M cad9e5a68ca32bc123de17d0b64419a2ba935ee5
M cb2da0a5a8c6c80aeeb4ad15e9281fa7a94e7ee6
M cbb59bbd3e9e4ae0259b43465fbff8b5c45991c0
M cbda73659ef909a691a1ac58b062b1b5e9355833
(cxf) 03/08: Bump org.webjars:swagger-ui from 5.18.1 to 5.18.2 (#2146)
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit e86f75afbdfa92f918aba818480b181e4759e530
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Tue Nov 12 07:48:58 2024 -0500
Bump org.webjars:swagger-ui from 5.18.1 to 5.18.2 (#2146)
Bumps [org.webjars:swagger-ui](https://github.com/swagger-api/swagger-ui) from 5.18.1 to 5.18.2.
- [Release notes](https://github.com/swagger-api/swagger-ui/releases)
- [Changelog](https://github.com/swagger-api/swagger-ui/blob/master/.releaserc)
- [Commits](https://github.com/swagger-api/swagger-ui/compare/v5.18.1...v5.18.2)
---
updated-dependencies:
- dependency-name: org.webjars:swagger-ui
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <su...@github.com>
Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
(cherry picked from commit 54c3ce63ef139f99c12f2290b2107c2f428fba51)
# Conflicts:
# distribution/src/main/release/samples/pom.xml
(cherry picked from commit f7d157d8090576a5874b9afb098ba65f5328c1b1)
(cherry picked from commit 65a0ec862f6d216a1da91ea3f53472aa72b9489e)
# Conflicts:
# parent/pom.xml
---
distribution/src/main/release/samples/pom.xml | 2 +-
parent/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index 8fc0c3535e..665585b90d 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -35,7 +35,7 @@
<cxf.jetty9.version>9.4.56.v20240826</cxf.jetty9.version>
<cxf.netty.version>4.1.114.Final</cxf.netty.version>
<cxf.httpcomponents.client.version>4.5.14</cxf.httpcomponents.client.version>
- <cxf.swagger.ui.version>5.18.1</cxf.swagger.ui.version>
+ <cxf.swagger.ui.version>5.18.2</cxf.swagger.ui.version>
<cxf.tika.version>2.9.1</cxf.tika.version>
<cxf.tomcat.version>9.0.96</cxf.tomcat.version>
<graalvm.version>21.1.0</graalvm.version>
diff --git a/parent/pom.xml b/parent/pom.xml
index 77696b4a29..1ff762e218 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -213,7 +213,7 @@
<cxf.spring.security.version>5.7.13</cxf.spring.security.version>
<cxf.spring.version>5.3.39</cxf.spring.version>
<cxf.stax-ex.version>1.8.3</cxf.stax-ex.version>
- <cxf.swagger.ui.version>5.18.1</cxf.swagger.ui.version>
+ <cxf.swagger.ui.version>5.18.2</cxf.swagger.ui.version>
<cxf.swagger.v3.version>2.1.13</cxf.swagger.v3.version>
<cxf.swagger2.version>1.6.11</cxf.swagger2.version>
<cxf.swagger2.guava.version>31.1-jre</cxf.swagger2.guava.version>
(cxf) 06/08: CXF-9076: Exception message is not unmarshalled with JDK17+ (limit the fix to JDK standard library exceptions) (#2148)
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 44fa0a5e5779f9561ca154f44b660d3f3eb419ff
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Nov 17 11:39:54 2024 -0500
CXF-9076: Exception message is not unmarshalled with JDK17+ (limit the fix to JDK standard library exceptions) (#2148)
(cherry picked from commit e6229afc8c15fe46b2c64116e76fea794af03f98)
(cherry picked from commit d78b7b686ee03fba361099472bfde787cc33a9ed)
(cherry picked from commit 87eab88212ede935cfdb6724284c465c161b249d)
---
.../cxf/interceptor/ClientFaultConverter.java | 54 +++++++++++++++-------
.../systest/jaxws/ClientServerExceptionServer.java | 5 ++
.../systest/jaxws/ClientServerExceptionTest.java | 20 ++++++--
.../apache/cxf/systest/jaxws/ExceptionService.java | 1 +
.../{ExceptionService.java => SayException.java} | 19 ++++++--
5 files changed, 76 insertions(+), 23 deletions(-)
diff --git a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
index c2c1f9c365..c270f4d920 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
@@ -200,21 +200,8 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
ReflectionUtil.setAccessible(f);
f.set(ex, fault.getMessage());
} catch (Exception e1) {
- try {
- // Fallback, try to clone the exception instead of accessing the detailMessage over reflection
- final Constructor<? extends Object> constructor = ReflectionUtil.getConstructor(ex.getClass(),
- String.class, Throwable.class); /* String message, Throwable cause */
-
- if (constructor != null) {
- final Exception clone = (Exception) constructor.newInstance(message, ex.getCause());
- clone.setStackTrace(ex.getStackTrace());
- if (ex.getSuppressed().length > 0) {
- Arrays.stream(ex.getSuppressed()).forEach(clone::addSuppressed);
- }
- ex = clone;
- }
- } catch (Exception e2) {
- /* nothing to do */
+ if (isJdkException(ex.getClass().getPackageName())) {
+ ex = cloneJdkException(ex, message);
}
}
}
@@ -222,6 +209,37 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
}
}
+ private static Exception cloneJdkException(Exception ex, final String message) {
+ try {
+ // Fallback, try to clone the exception instead of accessing the detailMessage
+ // over reflection
+ Constructor<? extends Object> constructor = ReflectionUtil.getConstructor(
+ ex.getClass(), String.class, Throwable.class); /* String message, Throwable cause */
+
+ Exception clone = null;
+ if (constructor != null) {
+ clone = (Exception) constructor.newInstance(message, ex.getCause());
+ } else {
+ constructor = ReflectionUtil.getConstructor(ex.getClass(), String.class); /* String message */
+ if (constructor != null) {
+ clone = (Exception) constructor.newInstance(message);
+ clone.initCause(ex.getCause());
+ }
+ }
+
+ if (clone != null) {
+ clone.setStackTrace(ex.getStackTrace());
+ if (ex.getSuppressed().length > 0) {
+ Arrays.stream(ex.getSuppressed()).forEach(clone::addSuppressed);
+ }
+ return clone;
+ }
+ } catch (Exception e2) {
+ /* nothing to do */
+ }
+ return ex;
+ }
+
private Constructor<?> getConstructor(Class<?> faultClass, Object e) throws NoSuchMethodException {
Class<?> beanClass = e.getClass();
Constructor<?>[] cons = faultClass.getConstructors();
@@ -300,7 +318,7 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
Throwable res = null;
if (firstLine.indexOf(':') != -1) {
String cn = firstLine.substring(0, firstLine.indexOf(':')).trim();
- if (cn.startsWith("java.lang")) {
+ if (isJdkException(cn)) {
try {
res = (Throwable)Class.forName(cn).getConstructor(String.class)
.newInstance(firstLine.substring(firstLine.indexOf(':') + 2));
@@ -327,6 +345,10 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
return res;
}
+ private static boolean isJdkException(String pkg) {
+ return pkg.startsWith("java.lang");
+ }
+
private static StackTraceElement parseStackTrackLine(String oneLine) {
StringTokenizer stInner = new StringTokenizer(oneLine, "!");
return new StackTraceElement(stInner.nextToken(), stInner.nextToken(),
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionServer.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionServer.java
index a20db6bd12..ff80a8d940 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionServer.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionServer.java
@@ -34,6 +34,11 @@ public class ClientServerExceptionServer extends AbstractBusTestServerBase {
public String saySomething(String text) throws IllegalArgumentException {
throw new IllegalArgumentException("Simulated!");
}
+
+ @Override
+ public String sayNothing(String text) throws SayException {
+ throw new SayException("Simulated!", 100);
+ }
}
protected void run() {
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionTest.java
index d0e8fe499c..6545d83709 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerExceptionTest.java
@@ -27,6 +27,7 @@ import javax.xml.ws.Service;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -35,20 +36,33 @@ import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
public class ClientServerExceptionTest extends AbstractBusClientServerTestBase {
+ private ExceptionService port;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue("server did not launch correctly", launchServer(ClientServerExceptionServer.class, true));
}
- @Test
- public void exceptionMessageIsPreserved() throws MalformedURLException {
+ @Before
+ public void setUp() throws Exception {
URL wsdlURL = new URL("http://localhost:" + ClientServerExceptionServer.PORT + "/ExceptionService?wsdl");
QName qname = new QName("http://cxf.apache.org/", "ExceptionService");
Service service = Service.create(wsdlURL, qname);
- ExceptionService port = service.getPort(ExceptionService.class);
+ port = service.getPort(ExceptionService.class);
+ }
+ @Test
+ public void exceptionMessageIsPreserved() throws MalformedURLException {
final IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
() -> port.saySomething("Hello World!"));
assertEquals("Simulated!", ex.getMessage());
}
+
+ @Test
+ public void exceptionCustomExceptionMessageIsPreserved() throws MalformedURLException {
+ final SayException ex = assertThrows(SayException.class,
+ () -> port.sayNothing("Hello World!"));
+ assertEquals("Simulated!", ex.getMessage());
+ assertEquals(100, ex.getCode());
+ }
}
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java
index fa2a525fa7..e2bf3e3c11 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java
@@ -24,4 +24,5 @@ import javax.jws.WebService;
@WebService
interface ExceptionService {
String saySomething(String text) throws IllegalArgumentException;
+ String sayNothing(String text) throws SayException;
}
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SayException.java
similarity index 70%
copy from systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java
copy to systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SayException.java
index fa2a525fa7..0201400b0e 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ExceptionService.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SayException.java
@@ -19,9 +19,20 @@
package org.apache.cxf.systest.jaxws;
-import javax.jws.WebService;
+public class SayException extends Exception {
+ private static final long serialVersionUID = 1L;
+ private final int code;
-@WebService
-interface ExceptionService {
- String saySomething(String text) throws IllegalArgumentException;
+ public SayException() {
+ this(null, 0);
+ }
+
+ public SayException(final String message, final int code) {
+ super(message);
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
}
(cxf) 01/08: Bump org.codehaus.mojo:exec-maven-plugin from 3.4.1 to 3.5.0 (#2143)
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 331d1137cfd4e03acf216560ec84dafb467176a1
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Mon Nov 11 15:58:19 2024 -0500
Bump org.codehaus.mojo:exec-maven-plugin from 3.4.1 to 3.5.0 (#2143)
Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases)
- [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.4.1...3.5.0)
---
updated-dependencies:
- dependency-name: org.codehaus.mojo:exec-maven-plugin
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <su...@github.com>
Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
(cherry picked from commit daeb13787ec40a215c12f84036d55a0f963c5f64)
(cherry picked from commit f21352aeb22b07a2f7e4e64cf772ebd66b992ca0)
(cherry picked from commit b712a60335df8d40e3a3cb06672432b8f2ca8b70)
---
distribution/src/main/release/samples/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index 78774e38de..8fc0c3535e 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -203,7 +203,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
- <version>3.4.1</version>
+ <version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
(cxf) 08/08: Fix compilation issue (post cherrypicking)
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.5.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit bff380a4e64415413f8ef76f5722b4d5fbb6c8d7
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Mon Nov 18 08:15:21 2024 -0500
Fix compilation issue (post cherrypicking)
---
core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
index c270f4d920..de4b4abc4b 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
@@ -200,7 +200,7 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
ReflectionUtil.setAccessible(f);
f.set(ex, fault.getMessage());
} catch (Exception e1) {
- if (isJdkException(ex.getClass().getPackageName())) {
+ if (isJdkException(ex.getClass().getName())) {
ex = cloneJdkException(ex, message);
}
}