-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
33.0.0.Final
-
None
-
-
User Experience
-
---
-
---
Having this simple RESTeasy RxJava2 service:
@GET @Produces(MediaType.APPLICATION_JSON)
@Stream public Flowable<String> getTimeZoneStream()
{
return Flowable.create(flowableEmitter ->
{
locations.forEach(location -> flowableEmitter.onNext(location));
flowableEmitter.onComplete();
}, BackpressureStrategy.BUFFER);
}
I'm getting the following exception:
024-09-03T14:55:16+02:00 WARN [org.jboss.resteasy.resteasy_jaxrs.i18n] (main) RESTEASY002155: Provider class org.jboss.resteasy.rxjava2.FlowableRxInvokerProvider is already registered. 2nd registration is being ignored.
5219 INFO [docker-java-stream--156694726] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT - STDOUT: 14:55:16,815 INFO [stdout] (default task-1) >>>>>>>>> TimeZoneStreamResource.getTimeZoneStream() called...
5456 ERROR [sse-event-source(http://localhost:9023/tz2)-thread-1] fr.simplex_software.react.rxjava2.test.TimeZoneStreamResourceIT - RESTEASY008200: JSON Binding deserialization error: jakarta.json.bind.JsonbException: Cannot create instance of a class: class org.jbo
ss.resteasy.plugins.providers.sse.SseEventInputImpl, No default constructor found.
jakarta.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: jakarta.json.bind.JsonbException: Cannot create instance of a class: class org.jboss.resteasy.plugins.providers.sse.SseEventInputImpl, No default constructor found.
at org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:78)
at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:99)
at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:81)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:192)
when trying to call it with the following client:
...
try (Client client = ClientBuilder.newClient().register(FlowableRxInvokerProvider.class))
{
FlowableRxInvoker invoker = client.target(timeUri).request().rx(FlowableRxInvoker.class);
Flowable<String> flowable = (Flowable<String>) invoker.get();
...
}
...
I'm using the following dependencies:
...
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-rxjava2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.21</version>
</dependency> ...
What might be the problem here ?