You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] 3.11.0: ApacheHttpClient5Transport fails with NoClassDefFoundError: org/reactivestreams/Publisher #2294
Since 3.11.0, building an ApacheHttpClient5Transport fails unless org.reactivestreams:reactive-streams happens to be on the classpath:
java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
at org.opensearch.client.transport.httpclient5.ApacheHttpClient5TransportBuilder.build(ApacheHttpClient5TransportBuilder.java:304)
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
The streaming support added in #2144 made ApacheHttpClient5Transport use org.reactivestreams.Publisher (in the signature of stream(...)), org.apache.hc.core5.reactive.ReactiveResponseConsumer (httpcore5-reactive) and reactor.core.publisher.Mono (reactor-core). None of them is declared in the published POM of opensearch-java 3.11.0. The build only gets them through opensearch-rest-client, which is compileOnly, and reactor-test, which is testImplementation, so the tests don't notice.
How can one reproduce the bug?
Depend on org.opensearch.client:opensearch-java:3.11.0 only (no opensearch-rest-client)
NoClassDefFoundError: org/reactivestreams/Publisher (works with 3.10.0)
What is the expected behavior?
The dependencies the transport needs are declared in the POM: reactive-streams (it is part of the public API of stream(...)), and httpcore5-reactive and reactor-core for the streaming path.
What is your host/environment?
opensearch-java 3.11.0, JDK 25. Found in Apache StormCrawler when bumping from 3.10.0 (apache/stormcrawler#2334); adding reactive-streams explicitly works around it there.
Activity
Declare the dependencies of the streaming support in ApacheHttpClient…
Declare the dependencies of the streaming support in ApacheHttpClient…