From af5ec5c1f743b2ec790ffca138cf77dc23e05136 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 14 Nov 2023 12:22:15 +0800 Subject: [PATCH 1/7] [JBWS-4399]:Use wildfly share build in jbossws nightly CI build --- .github/workflows/wildfly-build.yml | 52 ++++++++++++++++------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/wildfly-build.yml b/.github/workflows/wildfly-build.yml index 6834b5ebe..0d675953f 100644 --- a/.github/workflows/wildfly-build.yml +++ b/.github/workflows/wildfly-build.yml @@ -4,45 +4,49 @@ name: WildFly Test Build on: schedule: - - cron: '30 0 * * *' # Every day at 00:30 UTC + - cron: '30 0 * * *' # Every day at 00:30 UTC jobs: wildfly-build: - runs-on: ubuntu-latest - outputs: - wildfly-version: ${{steps.version.outputs.wildfly-version}} + uses: wildfly/wildfly/.github/workflows/shared-wildfly-build.yml@main + with: + wildfly-branch: "main" + wildfly-repo: "wildfly/wildfly" + jbossws-build: + runs-on: ${{ matrix.os }} + needs: wildfly-build + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest] + java: [ '17'] steps: - - name: Checkout WildFly - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 with: - repository: wildfly/wildfly - fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v2 + name: wildfly-maven-repository + path: . + - name: Extract Maven Repo + shell: bash + run: tar -xzf wildfly-maven-repository.tar.gz -C ~ + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'adopt' + java-version: ${{ matrix.java }} + distribution: 'temurin' cache: 'maven' - - name: Build WildFly - run: 'mvn clean install -Prelease,gendoc -DskipTests -Dcheckstyle.skip=true -Denforcer.skip=true' - - id: version - run: echo "::set-output name=wildfly-version::$(mvn -B help:evaluate -Dexpression=project.version -pl . | grep -v '^\[')" - - name: Checkout jbossws-cxf - uses: actions/checkout@v2 - with: - repository: jbossws/jbossws-cxf - name: Build with Maven Java ${{ matrix.java }} on WildFly ${{needs.wildfly-build.outputs.wildfly-version}} run: | mvn -s ./.m2-settings.xml -B -V -fae -Pwildflydev clean install - name: Upload surefire reports - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: surefire-reports-${{ matrix.os }}-${{ matrix.java }} - path: '**/surefire-reports/*.*' + path: '**/surefire-reports/' - name: Upload server logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: failure() with: name: server-logs-${{ matrix.os }}-${{ matrix.java }} - path: '**/*/*.log' + path: '**/*.log' \ No newline at end of file From 31031aededbaae1f826c1b25a4e23d7b0e8bfb0e Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 19 Sep 2023 10:09:01 +0800 Subject: [PATCH 2/7] [JBWS-4386]:Allow the system property config 'force.urlconnection.http.conduit' --- .../main/java/org/jboss/wsf/stack/cxf/client/Constants.java | 2 ++ .../stack/cxf/client/configuration/JBossWSBusFactory.java | 6 +++++- .../org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java index ea1ec3bcf..c1f0bcaeb 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java @@ -60,4 +60,6 @@ public class Constants public static final String JBWS_CXF_JAXWS_CLIENT_BUS_SELECTOR = "org.jboss.ws.cxf.jaxws-client.bus.selector"; public static final String JBWS_CXF_DISABLE_DEPLOYMENT_USER_DEFAULT_THREAD_BUS = "org.jboss.ws.cxf.disable-deployment-user-default-thread-bus"; public static final String JBWS_CXF_DISABLE_SCHEMA_CACHE = "org.jboss.ws.cxf.disableSchemaCache"; + //The flag to force use the URLConnectionHTTPConduit instead of the HttpClientHTTPConduit since CXF 4.0.3 + public static final String FORCE_URL_CONNECTION_CONDUIT = "force.urlconnection.http.conduit"; } diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java index c48d0bc77..0aa637c9a 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java @@ -32,6 +32,7 @@ import org.apache.cxf.configuration.Configurer; import org.apache.cxf.resource.ResourceManager; import org.jboss.wsf.stack.cxf.client.ClientBusSelector; +import org.jboss.wsf.stack.cxf.client.Constants; import org.jboss.wsf.stack.cxf.client.ProviderImpl; import org.jboss.wsf.stack.cxf.client.injection.JBossWSResourceInjectionResolver; @@ -45,7 +46,7 @@ public class JBossWSBusFactory extends CXFBusFactory { private static final Map classLoaderBusses = new WeakHashMap(); - + private static final boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); @Override public Bus createBus(Map, Object> extensions, Map properties) { if (extensions == null) @@ -75,6 +76,9 @@ protected void initializeBus(Bus bus) { final ResourceManager resourceManager = bus.getExtension(ResourceManager.class); resourceManager.addResourceResolver(JBossWSResourceInjectionResolver.getInstance()); SecurityProviderConfig.setup(bus); + if (forceURLConnectionConduit) { + bus.setProperty(Constants.FORCE_URL_CONNECTION_CONDUIT, true); + } } /** diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java index ec1da5040..e294b240e 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java @@ -53,10 +53,13 @@ import org.apache.cxf.transport.MessageObserver; import org.apache.cxf.transport.http.HTTPConduit; import org.jboss.logging.Logger; +import org.jboss.wsf.stack.cxf.client.Constants; +import org.jboss.wsf.stack.cxf.client.configuration.SecurityActions; public class SOAPConnectionImpl extends SOAPConnection { private volatile boolean closed = false; + private static final boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); @Override public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPException @@ -74,6 +77,9 @@ public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPExc Exchange exch = new ExchangeImpl(); outMessage.setExchange(exch); exch.put("org.apache.cxf.transport.process_fault_on_http_400", true); //JBWS-3945 + if (forceURLConnectionConduit) { + exch.put("Constants.FORCE_URL_CONNECTION_CONDUIT)", true); + } // sent SOAPMessage try From 09342dc2260dbf4c9076fde9bc7293a846b4ca7e Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 14 Nov 2023 14:47:39 +0800 Subject: [PATCH 3/7] [JBWS-4387]:Upgrade to CXF 4.0.4-SNAPSHOT --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 1c177c0dc..1e38dea64 100644 --- a/pom.xml +++ b/pom.xml @@ -72,8 +72,8 @@ 2.1.0 1.0.0 1.0.0 - 4.0.0 - 9.4 + 4.0.4-SNAPSHOT + 9.5 4.0.0 3.4.3.Final 2.2.1.Final @@ -88,9 +88,9 @@ 3.11 1.2 1.2.1.Final - 3.1.1 + 3.2.0 2.1.0 - 4.2.0 + 4.3.0 1.0.0.Final 3.0.0 2.3 From 55c61393a8a6560b4144109f05013c351bfd6dbd Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 19 Sep 2023 17:20:11 +0800 Subject: [PATCH 4/7] Fix import error --- .../java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java index e294b240e..7e866ccbb 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java @@ -54,7 +54,6 @@ import org.apache.cxf.transport.http.HTTPConduit; import org.jboss.logging.Logger; import org.jboss.wsf.stack.cxf.client.Constants; -import org.jboss.wsf.stack.cxf.client.configuration.SecurityActions; public class SOAPConnectionImpl extends SOAPConnection { From b614e66fff1549fde8106c0b0a6f1ef1530f9f92 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 19 Sep 2023 17:21:12 +0800 Subject: [PATCH 5/7] [JBWS-4387]:Fix test failures after upgrade to CXF 4.0.4 --- .../cxf/httpauth/HelloBasicSecTestCase.java | 6 +++--- .../samples/exception/JBWS3945TestCase.java | 2 +- .../securityDomain/PermitAllTestCase.java | 6 +++--- .../securityDomain/SecurityDomainTestCase.java | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpauth/HelloBasicSecTestCase.java b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpauth/HelloBasicSecTestCase.java index 94e748e5c..dcfc768cc 100644 --- a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpauth/HelloBasicSecTestCase.java +++ b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpauth/HelloBasicSecTestCase.java @@ -146,7 +146,7 @@ public void testElytronConfigIncorrectPassword() throws Exception { proxy.helloRequest("number"); fail("Authorization exception expected!"); } catch (Exception e) { - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } } finally { AuthenticationContext.getContextManager().setGlobalDefault(previousAuthContext); @@ -196,7 +196,7 @@ public void testBasicAuthFail() throws Exception proxy.helloRequest("number"); fail("Authorization exception expected!"); } catch (Exception e) { - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } } @@ -213,7 +213,7 @@ public void testBasicNoAuth() throws Exception proxy.helloRequest("number"); fail("Authorization exception expected!"); } catch (Exception e) { - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } } } diff --git a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/JBWS3945TestCase.java b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/JBWS3945TestCase.java index 994322c04..04b6f23ef 100644 --- a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/JBWS3945TestCase.java +++ b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/JBWS3945TestCase.java @@ -112,7 +112,7 @@ public void testSOAP12SoapFaultExceptionOnHTTP400() throws Exception catch (WebServiceException wse) { wse.printStackTrace(); - assertTrue(wse.getCause().getMessage().contains("400: Bad Request")); + assertTrue(wse.getCause().getMessage().contains("400")); } catch (Exception e) { diff --git a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java index 377e57eef..9f201a2eb 100644 --- a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java +++ b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/PermitAllTestCase.java @@ -80,7 +80,7 @@ public void testPortOne() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob"); @@ -107,7 +107,7 @@ public void testPortTwo() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } try { port.echoForAll("Hi"); @@ -115,7 +115,7 @@ public void testPortTwo() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue(e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue(e.getCause().getMessage().contains("401")); } ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob"); diff --git a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java index d4fd38243..9c3b0bfa1 100644 --- a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java +++ b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java @@ -118,7 +118,7 @@ public void testUnauthenticated() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } try { @@ -127,7 +127,7 @@ public void testUnauthenticated() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } try { @@ -136,7 +136,7 @@ public void testUnauthenticated() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } } @@ -152,7 +152,7 @@ public void testUnauthorized() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } ((BindingProvider)port2).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john"); ((BindingProvider)port2).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar"); @@ -200,7 +200,7 @@ public void testUndeclaredRole() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403: Forbidden")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403")); } try { port.echo("Hello"); @@ -208,7 +208,7 @@ public void testUndeclaredRole() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403: Forbidden")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403")); } try { port.restrictedEcho("Hello"); @@ -244,7 +244,7 @@ public void testEjbSecurityAuth() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob"); ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo"); @@ -288,7 +288,7 @@ private void testOneWay(SecureEndpoint port) throws Exception { e.printStackTrace(); //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401")); } ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob"); ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo"); From 1f644f36478e3de9d14d9b0d31aff3c08c95122d Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Wed, 12 Jul 2023 12:02:47 +0800 Subject: [PATCH 6/7] [JBWS-4387]:Add cxf modules and fix AddressingTestCase --- modules/feature-pack/pom.xml | 125 ++++++++++++++++ .../base/org/apache/cxf/impl/main/module.xml | 138 ++++++++++++++++++ .../base/org/apache/cxf/main/module.xml | 70 +++++++++ .../apache/cxf/services-sts/main/module.xml | 78 ++++++++++ .../apache/cxf/ws-security/main/module.xml | 65 +++++++++ .../jaxws/samples/wsa/AddressingTestCase.java | 2 +- 6 files changed, 477 insertions(+), 1 deletion(-) create mode 100644 modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/impl/main/module.xml create mode 100644 modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/main/module.xml create mode 100644 modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/services-sts/main/module.xml create mode 100644 modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/ws-security/main/module.xml diff --git a/modules/feature-pack/pom.xml b/modules/feature-pack/pom.xml index bfc365136..cbb39e106 100644 --- a/modules/feature-pack/pom.xml +++ b/modules/feature-pack/pom.xml @@ -65,6 +65,131 @@ opensaml-xacml-saml-impl provided + + + org.apache.cxf + cxf-core + + + org.apache.cxf + cxf-rt-ws-security + + + org.apache.cxf + cxf-rt-bindings-soap + + + org.apache.cxf + cxf-rt-bindings-coloc + + + org.apache.cxf + cxf-rt-databinding-jaxb + + + org.apache.cxf + cxf-rt-features-clustering + + + org.apache.cxf + cxf-rt-frontend-jaxws + + + org.apache.cxf + cxf-rt-management + + + org.apache.cxf + cxf-rt-transports-http + + + org.apache.cxf + cxf-rt-transports-jms + + + org.apache.cxf + cxf-rt-transports-local + + + org.apache.cxf + cxf-rt-transports-http-hc + + + org.apache.cxf + cxf-rt-bindings-xml + + + org.apache.cxf + cxf-rt-frontend-simple + + + org.apache.cxf + cxf-rt-ws-addr + + + org.apache.cxf + cxf-rt-wsdl + + + org.apache.cxf + cxf-rt-ws-mex + + + org.apache.cxf + cxf-rt-ws-rm + + + org.apache.cxf + cxf-rt-ws-policy + + + org.apache.cxf + cxf-tools-java2ws + + + org.apache.cxf.services.sts + cxf-services-sts-core + + + org.apache.cxf.services.ws-discovery + cxf-services-ws-discovery-api + + + org.apache.cxf + cxf-tools-wsdlto-core + + + org.apache.cxf + cxf-tools-wsdlto-databinding-jaxb + + + org.apache.cxf + cxf-tools-wsdlto-frontend-jaxws + + + org.apache.cxf + cxf-rt-features-logging + + + org.apache.cxf.xjcplugins + cxf-xjc-boolean + + + org.apache.cxf.xjcplugins + cxf-xjc-bug986 + + + org.apache.cxf.xjcplugins + cxf-xjc-dv + + + org.apache.cxf.xjcplugins + cxf-xjc-ts + + + org.apache.cxf.xjc-utils + cxf-xjc-runtime + org.wildfly wildfly-ee-galleon-pack diff --git a/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/impl/main/module.xml b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/impl/main/module.xml new file mode 100644 index 000000000..7051b3f31 --- /dev/null +++ b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/impl/main/module.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/main/module.xml b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/main/module.xml new file mode 100644 index 000000000..5d51742c5 --- /dev/null +++ b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/main/module.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/services-sts/main/module.xml b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/services-sts/main/module.xml new file mode 100644 index 000000000..a00008709 --- /dev/null +++ b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/services-sts/main/module.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/ws-security/main/module.xml b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/ws-security/main/module.xml new file mode 100644 index 000000000..ed788e4e9 --- /dev/null +++ b/modules/feature-pack/src/main/resources/modules/system/layers/base/org/apache/cxf/ws-security/main/module.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java index e41ac3ce6..5ecd435b0 100644 --- a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java +++ b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java @@ -143,7 +143,7 @@ public void testDecoupledEndpointForLongLastingProcessingOfInvocations() throws proxy.sayHello("Sleepy"); //this takes at least 30 secs fail("Timeout exception expected"); } catch (WebServiceException e) { - assertTrue(e.getCause() instanceof SocketTimeoutException); + assertTrue(e.getCause().getMessage().contains("Timeout")); } policy.setDecoupledEndpoint("http://" + getServerHost() + ":18181/jaxws-samples-wsa/decoupled-endpoint"); From 160391c79a3383f57e7f31b8f321bdda76a01c51 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Thu, 21 Sep 2023 13:54:12 +0800 Subject: [PATCH 7/7] [JBWS-4387]:Fix more test failures after CXF 4.0.4 upgrade --- .../cxf/client/configuration/JBossWSBusFactory.java | 2 +- .../wsf/stack/cxf/saaj/SOAPConnectionImpl.java | 6 +++--- .../cxf/httpproxy/HTTPProxyTestCaseForked.java | 8 ++++---- .../securityDomain/SecurityDomainTestCase.java | 2 +- .../test/ws/saaj/jbws3084/JBWS3084TestCase.java | 13 ++++++++++++- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java index 0aa637c9a..478a4f14f 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java @@ -46,7 +46,7 @@ public class JBossWSBusFactory extends CXFBusFactory { private static final Map classLoaderBusses = new WeakHashMap(); - private static final boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); + private final boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); @Override public Bus createBus(Map, Object> extensions, Map properties) { if (extensions == null) diff --git a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java index 7e866ccbb..0f196cb20 100644 --- a/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java +++ b/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java @@ -57,8 +57,8 @@ public class SOAPConnectionImpl extends SOAPConnection { - private volatile boolean closed = false; - private static final boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); + private volatile boolean closed = false; + private boolean forceURLConnectionConduit = Boolean.getBoolean(Constants.FORCE_URL_CONNECTION_CONDUIT); @Override public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPException @@ -77,7 +77,7 @@ public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPExc outMessage.setExchange(exch); exch.put("org.apache.cxf.transport.process_fault_on_http_400", true); //JBWS-3945 if (forceURLConnectionConduit) { - exch.put("Constants.FORCE_URL_CONNECTION_CONDUIT)", true); + exch.put(Constants.FORCE_URL_CONNECTION_CONDUIT, true); } // sent SOAPMessage diff --git a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java index 84c2c44df..3de5abeaf 100644 --- a/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java +++ b/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java @@ -106,7 +106,7 @@ public void testHttpProxy() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); - assertTrue(baos.toString().contains(testHost)); + assertTrue(baos.toString().contains("UnresolvedAddressException")); } //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407 @@ -121,7 +121,7 @@ public void testHttpProxy() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); - assertTrue(baos.toString().contains("407: Proxy Authentication Required")); + assertTrue(baos.toString().contains("407")); } //finally setup everything @@ -156,7 +156,7 @@ public void testHttpProxyUsingHTTPClientPolicy() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); - assertTrue(baos.toString().contains(testHost)); + assertTrue(baos.toString().contains("UnresolvedAddressException")); } //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407 @@ -175,7 +175,7 @@ public void testHttpProxyUsingHTTPClientPolicy() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); - assertTrue(baos.toString().contains("407: Proxy Authentication Required")); + assertTrue(baos.toString().contains("407")); } //finally setup authorization info too diff --git a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java index 9c3b0bfa1..99efb7e0f 100644 --- a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java +++ b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java @@ -216,7 +216,7 @@ public void testUndeclaredRole() throws Exception } catch (Exception e) { //expected web layer exception assertTrue(e.getMessage().contains("Could not send Message")); - assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403: Forbidden")); + assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403")); } } @Test diff --git a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java index 9408148d1..e8c15f9f0 100644 --- a/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java +++ b/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java @@ -42,6 +42,8 @@ import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.wsf.test.JBossWSTest; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -70,6 +72,16 @@ public static WebArchive createDeployments() { .setWebXML(new File(getTestResourcesDir() + "/saaj/jbws3084/WEB-INF/web.xml")); return archive; } + @BeforeClass + public static void forceURLConnection() { + //The new HttpClientConduit doesn't work for disabling the chunk mode + //https://issues.redhat.com/browse/JBWS-4388 + System.setProperty("force.urlconnection.http.conduit", "true"); + } + @AfterClass + public static void cleanupSystemProperty() { + System.clearProperty("force.urlconnection.http.conduit"); + } @Test @RunAsClient @@ -118,7 +130,6 @@ private void doTestSoapConnection(boolean disableChunking) throws Exception SOAPConnection con = conFac.createConnection(); final String serviceURL = baseURL.toString(); - URL endpoint = new URL(serviceURL); SOAPMessage response = con.call(msg, endpoint); QName sayHiResp = new QName("http://www.jboss.org/jbossws/saaj", "sayHelloResponse");