Armeria: AbstractServerHttpRequest constructor signature change on spring 5.3

Created on 23 Oct 2020  路  12Comments  路  Source: line/armeria

As the maintainers know, AbstractServerHttpRequest constructor signature change as below on spring 5.3 that version hit the release candidate 2. It means official release version coming soon. Pre-emptive Thanks

https://spring.io/blog/2020/10/13/spring-framework-5-3-0-rc2-available-now

https://github.com/spring-projects/spring-framework/commit/3276f818519f9bde187c4ccb83653c21c2e0e7fb#diff-80d003153fc35acd9545fb81c726d9aa41dffc39c507c590e03e07a2450ed1bf

java.lang.NoSuchMethodError: org/springframework/http/server/reactive/AbstractServerHttpRequest.<init>(Ljava/net/URI;Ljava/lang/String;Lorg/springframework/http/HttpHeaders;)V (loaded from file:/Users/wickedev/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.3.0-RC2/ce128df6b5debc37d8019a17773f8a31af7ffba8/spring-web-5.3.0-RC2.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@62918e21) called from class com.linecorp.armeria.spring.web.reactive.ArmeriaServerHttpRequest (loaded from file:/Users/wickedev/.gradle/caches/modules-2/files-2.1/com.linecorp.armeria/armeria-spring-boot2-webflux-autoconfigure/1.0.0/a5b511b31f065caba67d35b7d081735e81277898/armeria-spring-boot2-webflux-autoconfigure-1.0.0.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@62918e21).
    at com.linecorp.armeria.spring.web.reactive.ArmeriaServerHttpRequest.<init>(ArmeriaServerHttpRequest.java:60)
    at com.linecorp.armeria.spring.web.reactive.ArmeriaHttpHandlerAdapter.handle(ArmeriaHttpHandlerAdapter.java:54)
    at com.linecorp.armeria.spring.web.reactive.ArmeriaReactiveWebServerFactory.lambda$configureService$5(ArmeriaReactiveWebServerFactory.java:243)
    at com.linecorp.armeria.spring.web.reactive.ArmeriaReactiveWebServerFactory$$Lambda$472/0000000000000000.serve(Unknown Source)
    at com.linecorp.armeria.server.HttpServerHandler.handleRequest(HttpServerHandler.java:384)
    at com.linecorp.armeria.server.HttpServerHandler.channelRead(HttpServerHandler.java:249)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at com.linecorp.armeria.server.Http1RequestDecoder.channelRead(Http1RequestDecoder.java:215)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved(ByteToMessageDecoder.java:253)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:508)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:851)
dependencies

Most helpful comment

Spring Boot 2.4 that depends on spring 5.3 has been released. https://github.com/spring-projects/spring-boot/releases/tag/v2.4.0

All 12 comments

Thanks for letting us know the changes. That sounds like ABI incompatibility.
We will check it more when releasing Armeria with Spring 5.3.

Spring Boot 2.4 that depends on spring 5.3 has been released. https://github.com/spring-projects/spring-boot/releases/tag/v2.4.0

Spring HttpHeaders implements MultiValueMap<String, String> so it should be fine I guess. 馃

No, it doesn't guarantee.
However, it happens when a user uses Armeria 1.2.0(or older versions) with Spring 5.3.x
because Armeria 1.2.0 is compiled with Spring 5.2.9.
If a user uses Armeria 1.3.0 with Spring 5.3.X(perhaps 5.2.X as well, not 100% sure), then there are no compatibility issues.

If a user uses Armeria 1.3.0 with Spring 5.3.X(perhaps 5.2.X as well, not 100% sure), then there are no compatibility issues.

I think so too. If Armeria recompiles with Spring 5.3, it may go well with Spring 5.2.

Let me check the compatibility. 馃槈

Unfortunately, I confirmed that the new Armeria version that compiles with Spring 5.3.x cannot run with Spring 5.2.x.
The error produced at the same point.

- java.lang.NoSuchMethodError: org.springframework.http.server.reactive.AbstractServerHttpRequest.<init>(java.net.URI, java.lang.String, org.springframework.http.HttpHeaders)
+ java.lang.NoSuchMethodError: org.springframework.http.server.reactive.AbstractServerHttpRequest.<init>(java.net.URI, java.lang.String, org.springframework.util.MultiValueMap)

I filed an issue on spring framework https://github.com/spring-projects/spring-framework/issues/26151 and add a workaround to the upgrade PR(https://github.com/line/armeria/pull/3193/commits/ef177cb7fd0b20fc851a42f662fd81d0d4f63712).

Oops, thanks a lot, @ikhoon 馃檱

Closed by #3193

Was this page helpful?
0 / 5 - 0 ratings