question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE in a simple project Spring Boot (Servlet) + RSocket + Sleuth

See original GitHub issue

Describe the bug There is a NPE in a simple application based on Spring Boot 2.3.5.RELEASE or 2.3.6.RELEASE with RSocket and Sleuth in dependencies. The problem arises when trying to execute request-response from client to the server.

Caused by: java.lang.NullPointerException: null
	at io.rsocket.core.RequestOperator.currentContext(RequestOperator.java:89) ~[rsocket-core-1.0.3.jar:na]
	at reactor.core.publisher.Operators.reportThrowInSubscribe(Operators.java:230) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:71) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at io.rsocket.core.RequestOperator.<init>(RequestOperator.java:42) ~[rsocket-core-1.0.3.jar:na]
	at io.rsocket.core.RSocketRequester$1.<init>(RSocketRequester.java:271) ~[rsocket-core-1.0.3.jar:na]
	at io.rsocket.core.RSocketRequester.handleRequestResponse(RSocketRequester.java:271) ~[rsocket-core-1.0.3.jar:na]
	at io.rsocket.core.RSocketRequester.requestResponse(RSocketRequester.java:164) ~[rsocket-core-1.0.3.jar:na]
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onNext(FluxContextStart.java:96) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onNext(FluxContextStart.java:96) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1782) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:247) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:329) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1782) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.MonoCallable.subscribe(MonoCallable.java:61) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at reactor.core.publisher.Mono.block(Mono.java:1679) ~[reactor-core-3.3.11.RELEASE.jar:3.3.11.RELEASE]
	at example.ClientMain.run(ClientMain.java:32) ~[classes/:na]
	at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795) ~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	... 3 common frames omitted

Sample spring-boot-235-rsocket-npe-example.zip Attached zip containes Maven multi-module .pom with both server and client. To reproduce the bug just start server and then client.

Other info Switching Spring Cloud down from Hoxton.SR9 to Hoxton.SR8 doesn’t solve the issue.

Switching to Spring Boot 2.3.4.RELEASE fixes the issue. Upgrade to Spring Boot 2.4.0 also fixes it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SimSoniccommented, Nov 30, 2020

@marcingrzejszczak Yes, just comment it out from pom.xml and all works.

Specifically Sleuth is present in the debugger: image

0reactions
OlegDokukacommented, Dec 4, 2020

Looks like a bug on our side. Looking into it now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Cloud Sleuth customization
In Spring Cloud Sleuth, we instrument scheduled method execution so that the tracing information is passed between threads. You can disable this behavior...
Read more >
Lettuce throws NPE when the dependencis has spring-cloud ...
But it throws a NPE when get session from redis. And if I remove spring-cloud-starter-sleuth dependency, it won't happend. springboot version: ...
Read more >
[Solved]-Spring Boot 1.3.0 Websocket with Spring Security ...
Coding example for the question Spring Boot 1.3.0 Websocket with Spring Security DefaultSimpUserRegistry getSession NullPointerException-Springboot.
Read more >
Spring Boot - Tracing Micro Service Logs - Tutorialspoint
Most developers face difficulty of tracing logs if any issue occurred. This can be solved by Spring Cloud Sleuth and ZipKin server for...
Read more >
Tracing a Reactive Kotlin App with Spring Cloud Sleuth
This guide will discuss RSocket tracing with Spring Cloud Sleuth and Zipkin. We will ship data to Zipkin through HTTP/REST, Kafka, and RabbitMQ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found