diff --git a/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java b/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java index 35cc74932e6..131ff93f906 100644 --- a/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java +++ b/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java @@ -26,6 +26,7 @@ import jakarta.ws.rs.client.WebTarget; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import org.apache.cxf.BusFactory; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.junit.InSequence; @@ -64,6 +65,8 @@ public static WebArchive createDeployment() { @Before public void before() { this.client = ClientBuilder.newClient(); + //disable json-p / json-b default registration in JAX-RS 3.1 + BusFactory.getDefaultBus().setProperty("skip.jakarta.json.providers.registration", "true"); } @Test diff --git a/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java b/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java index 28f69d3ec21..d60cb0488c2 100644 --- a/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java +++ b/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java @@ -23,6 +23,8 @@ import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; import net.minidev.json.JSONObject; +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; import org.apache.cxf.feature.LoggingFeature; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.johnzon.jaxrs.JohnzonProvider; @@ -69,6 +71,10 @@ public static WebArchive createDeployment() { @Test public void movieRestTest() throws Exception { + final Bus bus = BusFactory.getDefaultBus(); + //disable json-p / json-b default registration in JAX-RS 3.1 + bus.setProperty("skip.jakarta.json.providers.registration", "true"); + final WebClient webClient = WebClient .create(base.toExternalForm(), singletonList(new JohnzonProvider<>()), singletonList(new LoggingFeature()), null); @@ -82,7 +88,6 @@ public void movieRestTest() throws Exception { LOGGER.info("responsePayload = " + responsePayload); assertEquals("alice", responsePayload); - // Testing REST endpoint with group claims manager Book newBook = new Book(1, "The Lord of the Rings", "J.R.R.Tolkien"); Response response = webClient.reset() diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java index c139b626e84..b981a4ef279 100644 --- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java +++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java @@ -213,6 +213,8 @@ public void init(final Properties properties) throws Exception { private void initCxfProviders(final Bus bus) { if (noProvidersExplicitlyAdded(bus)) { bus.setProperty("skip.default.json.provider.registration", "true"); // client jaxrs, we want johnzon not jettison + bus.setProperty("skip.jakarta.json.providers.registration", + SystemInstance.get().getProperty("openejb.jaxrs.skip.jakarta.json.providers.registration", "true")); // Make sure default JAXRS 3.1 JSON-P/JSON-B providers are not loaded final Collection defaults = new ArrayList<>(); List jsonProviders; diff --git a/tck/jax-rs/jax-rs-tests-embedded/pom.xml b/tck/jax-rs/jax-rs-tests-embedded/pom.xml index b5a8ffdd675..0b0ff598d05 100644 --- a/tck/jax-rs/jax-rs-tests-embedded/pom.xml +++ b/tck/jax-rs/jax-rs-tests-embedded/pom.xml @@ -152,6 +152,7 @@ j2ee javajoe javajoe + false diff --git a/tck/jax-rs/jax-rs-tests/pom.xml b/tck/jax-rs/jax-rs-tests/pom.xml index 0556ee1dc91..ded386ce325 100644 --- a/tck/jax-rs/jax-rs-tests/pom.xml +++ b/tck/jax-rs/jax-rs-tests/pom.xml @@ -168,6 +168,7 @@ j2ee javajoe javajoe + false