sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

`ClassNotFoundException` for `SentryReactorUtils` when excluding the `sentry-reactor` dependency

Open adinauer opened this issue 3 months ago • 2 comments

Integration

sentry

Java Version

17

Version

8.23.0

Steps to Reproduce

Use spring-boot-jakarta dependency but exclude sentry-reactor dependency in WebFlux sample. Have a @GetMapping method that throws an exception.

Expected Result

Exception captured to Sentry

We could have a SentryWebExceptionHandlerWithThreadLocalAccessor in addition to SentryWebExceptionHandler, then have SentryWebExceptionHandler not use SentryReactor. This would mimic what we do for SentryWebFilterWithThreadLocalAccessor and SentryWebFilter.

Actual Result

Caused by: java.lang.ClassNotFoundException: io.sentry.reactor.SentryReactorUtils

and

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

and the ClassNotFoundException is reported to Sentry instead of the real exception.

adinauer avatar Oct 08 '25 14:10 adinauer

JAVA-199

linear[bot] avatar Oct 08 '25 14:10 linear[bot]

Came up while testing workarounds for https://github.com/getsentry/sentry-java/issues/4762

adinauer avatar Oct 08 '25 14:10 adinauer