[
https://issues.apache.org/jira/browse/SM-5023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Stoch updated SM-5023:
-----------------------------
Description:
I am trying to use spring-web and spring-webflux 5.3.15 bundle and
JettyClientHttpConnector class:
{code}
ClientHttpConnector connector = new JettyClientHttpConnector();
WebClient webClient =
WebClient.builder().clientConnector(connector).build();
final RequestHeadersSpec<?> spec =
webClient.get().uri("https://jsonplaceholder.typicode.com/comments");
spec.retrieve();
{code}
The first call raises an exception:
{noformat}
java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
...
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
cannot be found by org.apache.servicemix.bundles.spring-web_5.3.15.1
{noformat}
I thing this spring-web bundle misses some (optional?) import of:
org.reactivestreams, org.eclipse.jetty.client. Maybe there are more missing
imports like reactor.core.publisher, ...?
I have added these two imports to test:
{noformat}
org.reactivestreams,org.eclipse.jetty.client
{noformat}
And now an exception is raised in the second linie of code above (WebClient
creation):
{noformat}
java.lang.NoClassDefFoundError: Could not initialize class
org.springframework.web.reactive.function.client.DefaultExchangeStrategiesBuilder
{noformat}
was:
I am trying to use spring-web-5.3.15 bundle and JettyClientHttpConnector class:
{code}
ClientHttpConnector connector = new JettyClientHttpConnector();
{code}
This call raises an exception:
{noformat}
java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
...
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
cannot be found by org.apache.servicemix.bundles.spring-web_5.3.15.1
{noformat}
I thing this bundle misses some (optional?) import of "org.reactivestreams".
Maybe there are more missing imports like "reactor.core.publisher", ...?
> Spring-web and Spring-webflux miss some import packages
> -------------------------------------------------------
>
> Key: SM-5023
> URL: https://issues.apache.org/jira/browse/SM-5023
> Project: ServiceMix
> Issue Type: Bug
> Affects Versions: bundles-2022.01
> Reporter: Daniel Stoch
> Priority: Major
>
> I am trying to use spring-web and spring-webflux 5.3.15 bundle and
> JettyClientHttpConnector class:
> {code}
> ClientHttpConnector connector = new JettyClientHttpConnector();
> WebClient webClient =
> WebClient.builder().clientConnector(connector).build();
> final RequestHeadersSpec<?> spec =
> webClient.get().uri("https://jsonplaceholder.typicode.com/comments");
> spec.retrieve();
> {code}
> The first call raises an exception:
> {noformat}
> java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
> ...
> Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
> cannot be found by org.apache.servicemix.bundles.spring-web_5.3.15.1
> {noformat}
> I thing this spring-web bundle misses some (optional?) import of:
> org.reactivestreams, org.eclipse.jetty.client. Maybe there are more missing
> imports like reactor.core.publisher, ...?
> I have added these two imports to test:
> {noformat}
> org.reactivestreams,org.eclipse.jetty.client
> {noformat}
> And now an exception is raised in the second linie of code above (WebClient
> creation):
> {noformat}
> java.lang.NoClassDefFoundError: Could not initialize class
> org.springframework.web.reactive.function.client.DefaultExchangeStrategiesBuilder
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)