From 6c58561bd90dc3e0797d2e509ca55bd051c3b292 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 10 Oct 2022 11:17:19 +0300 Subject: [PATCH] Ensure that providers in RESTEasy Reactive common module aren't discoverable. These providers are registered manually, but previously because they were annotated with @Provider, they could be inadvertently registered as application classes in some test cases (essentially if an actual application class extended them). Added note about sorting - this note is needed in order to folks debugging in the future from going down the wrong path and having the TCK fail. Fix ChunkedResponseTest to be spec compliant. --- .../test/response/ChunkedResponseTest.java | 39 +++++++++++++------ .../reactive/common/core/Serialisers.java | 6 ++- .../ServerBooleanMessageBodyHandler.java | 2 - .../ServerByteArrayMessageBodyHandler.java | 2 - .../ServerCharArrayMessageBodyHandler.java | 2 - .../ServerCharacterMessageBodyHandler.java | 2 - .../ServerDefaultTextPlainBodyHandler.java | 2 - .../serialisers/ServerFileBodyHandler.java | 2 - .../ServerFilePartBodyHandler.java | 2 - .../ServerFormUrlEncodedProvider.java | 2 - .../ServerInputStreamMessageBodyHandler.java | 2 - .../ServerNumberMessageBodyHandler.java | 2 - .../serialisers/ServerPathBodyHandler.java | 2 - .../ServerPathPartBodyHandler.java | 2 - .../ServerStringMessageBodyHandler.java | 2 - 15 files changed, 33 insertions(+), 38 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/response/ChunkedResponseTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/response/ChunkedResponseTest.java index 1bd68e6a2d9bbd..ae68349b887c22 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/response/ChunkedResponseTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/response/ChunkedResponseTest.java @@ -7,14 +7,21 @@ import java.io.IOException; import java.io.OutputStream; import java.io.UncheckedIOException; +import java.lang.annotation.Annotation; import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import javax.annotation.Priority; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.Priorities; import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.Provider; -import org.jboss.resteasy.reactive.server.providers.serialisers.ServerStringMessageBodyHandler; +import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; +import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.Test; @@ -68,29 +75,39 @@ public String helloSmall() { } @Provider - public static class CustomStringMessageBodyWriter extends ServerStringMessageBodyHandler { + public static class CustomStringMessageBodyWriter implements ServerMessageBodyWriter { @Override - public void writeResponse(Object o, Type genericType, ServerRequestContext context) - throws WebApplicationException { + public boolean isWriteable(Class type, Type genericType, ResteasyReactiveResourceInfo target, MediaType mediaType) { + return true; + } - try (OutputStream stream = context.getOrCreateOutputStream()) { - stream.write(((String) o).getBytes()); - } catch (IOException e) { - throw new UncheckedIOException(e); - } + @Override + public void writeResponse(String o, Type genericType, ServerRequestContext context) throws WebApplicationException { + context.serverResponse().end(o); + } + + public boolean isWriteable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return true; + } + + public void writeTo(String o, Class type, Type genericType, Annotation[] annotations, MediaType mediaType, + MultivaluedMap httpHeaders, OutputStream entityStream) + throws IOException, WebApplicationException { + entityStream.write(o.getBytes(StandardCharsets.UTF_8)); } } @Provider + @Priority(Priorities.USER + 1) // the spec says that when it comes to writers, higher number means higher priority... public static final class CustomStringMessageBodyWriter2 extends CustomStringMessageBodyWriter { @Override - public void writeResponse(Object o, Type genericType, ServerRequestContext context) + public void writeResponse(String o, Type genericType, ServerRequestContext context) throws WebApplicationException { try (OutputStream stream = context.getOrCreateOutputStream()) { - stream.write(((String) o).getBytes()); + stream.write(o.getBytes()); } catch (IOException e) { throw new UncheckedIOException(e); } diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java index 3f0b755be1ab09..1f5020bae6a4b6 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java @@ -151,7 +151,11 @@ public List> findBuildTimeWriters(Class entityType, Runt } } - return toMessageBodyWriters(findResourceWriters(writers, klass, produces, runtimeType)); + + var resourceWriters = findResourceWriters(writers, klass, produces, runtimeType); + // we must NOT sort here because the spec mentions that the writers closer to the requested java type are tried first + // and the list has already been built up in this way + return toMessageBodyWriters(resourceWriters); } protected List findResourceWriters(QuarkusMultivaluedMap, ResourceWriter> writers, Class klass, diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerBooleanMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerBooleanMessageBodyHandler.java index 57c631c833a278..2be468dd0a7bfe 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerBooleanMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerBooleanMessageBodyHandler.java @@ -5,14 +5,12 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.BooleanMessageBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerBooleanMessageBodyHandler extends BooleanMessageBodyHandler implements ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerByteArrayMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerByteArrayMessageBodyHandler.java index 179b7ad9d40a12..1c1072159d824a 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerByteArrayMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerByteArrayMessageBodyHandler.java @@ -5,7 +5,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.ByteArrayMessageBodyHandler; import org.jboss.resteasy.reactive.common.providers.serialisers.MessageReaderUtil; @@ -14,7 +13,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerByteArrayMessageBodyHandler extends ByteArrayMessageBodyHandler implements ServerMessageBodyWriter, ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharArrayMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharArrayMessageBodyHandler.java index d853248c25e623..ce54d00bc73d6b 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharArrayMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharArrayMessageBodyHandler.java @@ -5,7 +5,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.CharArrayMessageBodyHandler; import org.jboss.resteasy.reactive.common.providers.serialisers.MessageReaderUtil; @@ -14,7 +13,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerCharArrayMessageBodyHandler extends CharArrayMessageBodyHandler implements ServerMessageBodyWriter, ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharacterMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharacterMessageBodyHandler.java index 5b7bbef52b761a..e96f0c7d8dc7ef 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharacterMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerCharacterMessageBodyHandler.java @@ -5,14 +5,12 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.CharacterMessageBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerCharacterMessageBodyHandler extends CharacterMessageBodyHandler implements ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerDefaultTextPlainBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerDefaultTextPlainBodyHandler.java index 9bf58af235dad8..51779b09fe86eb 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerDefaultTextPlainBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerDefaultTextPlainBodyHandler.java @@ -9,14 +9,12 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.DefaultTextPlainBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider @Consumes("text/plain") public class ServerDefaultTextPlainBodyHandler extends DefaultTextPlainBodyHandler implements ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFileBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFileBodyHandler.java index 96a9280a5db8b0..cb8fb60eca0a2a 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFileBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFileBodyHandler.java @@ -8,14 +8,12 @@ import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.FileBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider @Produces("*/*") @Consumes("*/*") public class ServerFileBodyHandler extends FileBodyHandler implements ServerMessageBodyWriter { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFilePartBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFilePartBodyHandler.java index ed08a6b5c1e28a..6e820b21eab73e 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFilePartBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFilePartBodyHandler.java @@ -7,7 +7,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.FilePart; import org.jboss.resteasy.reactive.common.providers.serialisers.FilePartBodyHandler; @@ -18,7 +17,6 @@ // TODO: this is very simplistic at the moment -@Provider @Produces("*/*") @Consumes("*/*") public class ServerFilePartBodyHandler extends FilePartBodyHandler implements ServerMessageBodyWriter { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFormUrlEncodedProvider.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFormUrlEncodedProvider.java index 8816b553e3098c..e5156e69a61c8f 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFormUrlEncodedProvider.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerFormUrlEncodedProvider.java @@ -11,7 +11,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.MapAsFormUrlEncodedProvider; import org.jboss.resteasy.reactive.common.providers.serialisers.MessageReaderUtil; @@ -25,7 +24,6 @@ * @version $Revision: 1 $ */ @SuppressWarnings("rawtypes") -@Provider @Produces("application/x-www-form-urlencoded") @Consumes("application/x-www-form-urlencoded") @ConstrainedTo(RuntimeType.CLIENT) diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerInputStreamMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerInputStreamMessageBodyHandler.java index 279eea052b6b61..e425943db55d28 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerInputStreamMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerInputStreamMessageBodyHandler.java @@ -7,7 +7,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.InputStreamMessageBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; @@ -15,7 +14,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerInputStreamMessageBodyHandler extends InputStreamMessageBodyHandler implements ServerMessageBodyReader, ServerMessageBodyWriter { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerNumberMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerNumberMessageBodyHandler.java index 35819c4697228d..260f7c985d8089 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerNumberMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerNumberMessageBodyHandler.java @@ -5,14 +5,12 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.NumberMessageBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerNumberMessageBodyHandler extends NumberMessageBodyHandler implements ServerMessageBodyReader { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathBodyHandler.java index 7183a8c02d856f..9978e13d19e603 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathBodyHandler.java @@ -9,7 +9,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.PathBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; @@ -17,7 +16,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider @Produces("*/*") public class ServerPathBodyHandler extends PathBodyHandler implements ServerMessageBodyWriter { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathPartBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathPartBodyHandler.java index ff2cfcaa5f5cc4..0e5fe867bef723 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathPartBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerPathPartBodyHandler.java @@ -9,7 +9,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.PathPart; import org.jboss.resteasy.reactive.common.providers.serialisers.PathPartBodyHandler; @@ -18,7 +17,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider @Produces("*/*") public class ServerPathPartBodyHandler extends PathPartBodyHandler implements ServerMessageBodyWriter { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerStringMessageBodyHandler.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerStringMessageBodyHandler.java index f4dbf1898226d6..45564ddd73973b 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerStringMessageBodyHandler.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/providers/serialisers/ServerStringMessageBodyHandler.java @@ -5,7 +5,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; import org.jboss.resteasy.reactive.common.providers.serialisers.StringMessageBodyHandler; import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo; @@ -13,7 +12,6 @@ import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyWriter; import org.jboss.resteasy.reactive.server.spi.ServerRequestContext; -@Provider public class ServerStringMessageBodyHandler extends StringMessageBodyHandler implements ServerMessageBodyWriter, ServerMessageBodyReader {