Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaded jar contains old incompatible version of reactor-core #73

Closed
dsyer opened this issue Oct 16, 2019 · 2 comments
Closed

Shaded jar contains old incompatible version of reactor-core #73

dsyer opened this issue Oct 16, 2019 · 2 comments
Assignees

Comments

@dsyer
Copy link
Contributor

dsyer commented Oct 16, 2019

If you build an app with webflux and Spring Boot 2.2 and then add this jar to the classpath it barfs on every HTTP request because of an old version of reactor-core that gets shaded into the auto-reconfiguration jar:

2019-10-16 11:05:26.798 ERROR 118 --- [or-http-epoll-2] reactor.netty.http.server.HttpServer     : [id: 0x87411ee4, L:/172.17.0.2:8080 - R:/172.17.0.1:39434] 

java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono reactor.core.publisher.Mono.transformDeferred(java.util.function.Function)'
	at org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter.filter(MetricsWebFilter.java:88) ~[spring-boot-actuator-2.2.0.RC1.jar:2.2.0.RC1]
	at org.springframework.web.server.handler.DefaultWebFilterChain.invokeFilter(DefaultWebFilterChain.java:126) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
	at org.springframework.web.server.handler.DefaultWebFilterChain.lambda$filter$0(DefaultWebFilterChain.java:121) ~[spring-web-5.2.0.RELEASE.jar:5.2.0.RELEASE]
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44) ~[java-buildpack-auto-reconfiguration-2.10.0.RELEASE.jar:na]
	...
@dsyer
Copy link
Contributor Author

dsyer commented Oct 16, 2019

It looks like maybe the reactor dependency is pulled in via spring-data-redis. It's fixed in Spring Boot 2.2, but with the 2.1 version used here it pulls in reactor-core and reactive-streams with scope=compile (so they are added to the shaded jar inadvertently and unnecessarily).

@dsyer
Copy link
Contributor Author

dsyer commented Oct 16, 2019

The problem is with reactor (reactor/reactor#677). To fix it here we would need to declare the test scope explicitly for all the reactor dependencies.

@nebhale nebhale self-assigned this Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants