diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index 81cdd0773de..534a7db1e34 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -9,15 +9,15 @@ javaPlatform { dependencies { api(platform("com.fasterxml.jackson:jackson-bom:2.15.4")) api(platform("io.micrometer:micrometer-bom:1.13.0")) - api(platform("io.netty:netty-bom:4.1.109.Final")) + api(platform("io.netty:netty-bom:4.1.110.Final")) api(platform("io.netty:netty5-bom:5.0.0.Alpha5")) api(platform("io.projectreactor:reactor-bom:2024.0.0-M2")) api(platform("io.rsocket:rsocket-bom:1.1.3")) api(platform("org.apache.groovy:groovy-bom:4.0.21")) api(platform("org.apache.logging.log4j:log4j-bom:2.21.1")) api(platform("org.assertj:assertj-bom:3.26.0")) - api(platform("org.eclipse.jetty:jetty-bom:12.0.9")) - api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.9")) + api(platform("org.eclipse.jetty:jetty-bom:12.0.10")) + api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.10")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3")) api(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.0")) api(platform("org.junit:junit-bom:5.10.2")) @@ -130,7 +130,7 @@ dependencies { api("org.hsqldb:hsqldb:2.7.2") api("org.htmlunit:htmlunit:4.1.0") api("org.javamoney:moneta:1.4.2") - api("org.jruby:jruby:9.4.6.0") + api("org.jruby:jruby:9.4.7.0") api("org.junit.support:testng-engine:1.0.5") api("org.mozilla:rhino:1.7.14") api("org.ogce:xpp3:1.1.6") @@ -139,7 +139,7 @@ dependencies { api("org.seleniumhq.selenium:htmlunit3-driver:4.20.0") api("org.seleniumhq.selenium:selenium-java:4.20.0") api("org.skyscreamer:jsonassert:1.5.1") - api("org.slf4j:slf4j-api:2.0.12") + api("org.slf4j:slf4j-api:2.0.13") api("org.testng:testng:7.9.0") api("org.webjars:underscorejs:1.8.3") api("org.webjars:webjars-locator-core:0.55") diff --git a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientRequest.java b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientRequest.java index b399ca27a25..b60f37c98ec 100644 --- a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientRequest.java +++ b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientRequest.java @@ -42,6 +42,7 @@ import org.springframework.util.StreamUtils; * Created via the {@link ReactorNettyClientRequestFactory}. * * @author Arjen Poutsma + * @author Juergen Hoeller * @since 6.1 */ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest { @@ -101,18 +102,8 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest return result; } } - catch (RuntimeException ex) { // Exceptions.ReactiveException is package private - Throwable cause = ex.getCause(); - - if (cause instanceof UncheckedIOException uioEx) { - throw uioEx.getCause(); - } - else if (cause instanceof IOException ioEx) { - throw ioEx; - } - else { - throw new IOException(ex.getMessage(), cause); - } + catch (RuntimeException ex) { + throw convertException(ex); } } @@ -136,6 +127,22 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest } } + static IOException convertException(RuntimeException ex) { + // Exceptions.ReactiveException is package private + Throwable cause = ex.getCause(); + + if (cause instanceof IOException ioEx) { + return ioEx; + } + if (cause instanceof UncheckedIOException uioEx) { + IOException ioEx = uioEx.getCause(); + if (ioEx != null) { + return ioEx; + } + } + return new IOException(ex.getMessage(), cause); + } + private static final class ByteBufMapper implements OutputStreamPublisher.ByteMapper { diff --git a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java index 984166d6cd0..4c314d13383 100644 --- a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java +++ b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java @@ -33,6 +33,7 @@ import org.springframework.util.StreamUtils; * {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client. * * @author Arjen Poutsma + * @author Juergen Hoeller * @since 6.1 */ final class ReactorNettyClientResponse implements ClientHttpResponse { @@ -79,8 +80,13 @@ final class ReactorNettyClientResponse implements ClientHttpResponse { return body; } - body = this.connection.inbound().receive() - .aggregate().asInputStream().block(this.readTimeout); + try { + body = this.connection.inbound().receive().aggregate().asInputStream().block(this.readTimeout); + } + catch (RuntimeException ex) { + throw ReactorNettyClientRequest.convertException(ex); + } + if (body == null) { throw new IOException("Could not receive body"); }