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 2022/07/07 17:40:00 UTC

[cxf] branch 3.6.x-fixes updated (7fd567e59b -> d7b9a3095d)

This is an automated email from the ASF dual-hosted git repository.

reta pushed a change to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


    from 7fd567e59b Recording .gitmergeinfo Changes
     new 1823d59b20 CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint
     new d7b9a3095d Recording .gitmergeinfo Changes

The 2 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:
 .gitmergeinfo                                       |  2 ++
 .../clustering/AbstractStaticFailoverStrategy.java  |  2 +-
 .../apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java | 21 +++++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)


[cxf] 02/02: 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.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit d7b9a3095d864a6b41dc0ee07dffbd0c36d7cdf6
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Thu Jul 7 13:39:48 2022 -0400

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 2770d2261d..1c1f1efd3a 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -33,11 +33,13 @@ M 7501891ee05153ba43eab3cdadccf789dd15de1e
 M 797df326d9b73cdaa02851a9cdc7d07bc05aad2c
 M 905f4f91e4d0b5c4d145729f16bad90b1847f0be
 M 96e71237bae2eb987a5fbe67d21e9e1e19f2d158
+M 9c3dc283369f6c829b040920cbb93002daf3d440
 M a903a5392b3cd2b5925c6afa46f289b3b94a694a
 M a9a32266a14c3956186a63e408d8d75c2f47bb0f
 M b15e3580e8f8692b2ffd51e6b2c44ce9dd8a5730
 M b207c718e84bed8120bb114f1d79f575094c3a14
 M b6e3ab83a37cfb777d6eebf9711e552027bde37a
+M b9569dad4a4636af572b23414a9ee8a67c2daee6
 M c5b7db5a4cceb3df6094ee38215725fd4ecc2b8c
 M ca46bebe06bc2732907e476bfe6116f09fbe1eb4
 M d26294e7f6a011101ec76bc707255899b7539755


[cxf] 01/02: CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 1823d59b20554658d4cfaac407d66d1c6923d57a
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Thu Jul 7 13:33:20 2022 -0400

    CXF-8735: AbstractStaticFailoverStrategy: UnsupportedOperationException when there are no services associated with the endpoint
    
    (cherry picked from commit 9c3dc283369f6c829b040920cbb93002daf3d440)
---
 .../clustering/AbstractStaticFailoverStrategy.java  |  2 +-
 .../apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
index 68535cc9f6..09755dd8f6 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java
@@ -138,7 +138,7 @@ public abstract class AbstractStaticFailoverStrategy implements FailoverStrategy
         // If there are no services associated with this endpoint (often in case of JAX-RS), 
         // returning the endpoint itself if allowed.
         if (services.isEmpty() && acceptCandidatesWithSameAddress) {
-            return Collections.singletonList(endpoint);
+            return new ArrayList<>(Collections.singleton(endpoint));
         }
         
         QName currentBinding = endpoint.getBinding().getBindingInfo().getName();
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
index cee49ed4c9..eb70ed1caa 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
@@ -43,6 +43,8 @@ import javax.xml.ws.Service;
 import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.clustering.FailoverFeature;
+import org.apache.cxf.clustering.RetryStrategy;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.ext.logging.LoggingInInterceptor;
 import org.apache.cxf.ext.logging.LoggingOutInterceptor;
@@ -917,6 +919,25 @@ public class JAXRSSoapBookTest extends AbstractBusClientServerTestBase {
         }
     }
 
+    @Test
+    public void testCheckBookClientErrorResponseWithFailover() {
+        final RetryStrategy retry = new RetryStrategy();
+        retry.setMaxNumberOfRetries(1);
+
+        final FailoverFeature failoverFeature = new FailoverFeature();
+        failoverFeature.setStrategy(retry);
+        
+        String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
+        BookStoreJaxrsJaxws proxy = JAXRSClientFactory.create(baseAddress,
+                                          BookStoreJaxrsJaxws.class,
+                                          Collections.singletonList(new DummyResponseExceptionMapper()),
+                                          Collections.singletonList(failoverFeature),
+                                          null);
+        
+        Response response = proxy.checkBook(100L);
+        assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
+    }
+
     private void serverFaultInInterceptorTest(String param) {
         String baseAddress = "http://localhost:" + PORT + "/test/services/rest";
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();