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

http-client throws NoSuchMethodError 'boolean com.fasterxml.jackson.core.io.NumberInput.looksLikeValidNumber(java.lang.String)' #10745

Closed
nedelva opened this issue Apr 19, 2024 · 7 comments
Labels
type: regression A breaking change was introduced in a minor or patch release

Comments

@nedelva
Copy link

nedelva commented Apr 19, 2024

Expected Behavior

I tried to upgrade the platform from 4.3.8 to 4.4.0. When doing so, a few tests using Jackson serialization threw the NoSuchMethodError error.
Looking at the micronaut-core-bom-4.4.3.pom I noticed that Jackson Databind and Jackson Core have different versions:

<jackson.databind.version>2.17.0</jackson.databind.version>
<jackson.version>2.16.1</jackson.version>

Since Databind depends on Core, their versions usually go hand in hand. Any particular reason why this happened?

Actual Behaviour

Here's the stacktrace:

2024-04-19 10:34:30  DEBUG DefaultHttpClient - Sending HTTP GET to http://localhost:4444/etc/etc/some_url_here
2024-04-19 10:34:30  WARN  DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NoSuchMethodError: 'boolean com.fasterxml.jackson.core.io.NumberInput.looksLikeValidNumber(java.lang.String)'
	at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$BigDecimalDeserializer.deserialize(NumberDeserializers.java:1052) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$BigDecimalDeserializer.deserialize(NumberDeserializers.java:990) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:545) ~[jackson-databind-2.17.0.jar:2.17.0]
	at io.micronaut.jackson.modules.BeanIntrospectionModule$BeanIntrospectionSetter.deserializeAndSet(BeanIntrospectionModule.java:1124) ~[micronaut-jackson-databind-4.4.3.jar:4.4.3]
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:273) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:155) ~[jackson-module-afterburner-2.16.1.jar:2.16.1]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:246) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:2099) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1249) ~[jackson-databind-2.17.0.jar:2.17.0]
	at io.micronaut.jackson.databind.JacksonDatabindMapper.readValue(JacksonDatabindMapper.java:199) ~[micronaut-jackson-databind-4.4.3.jar:4.4.3]
	at io.micronaut.json.body.JsonMessageHandler.read(JsonMessageHandler.java:106) ~[micronaut-json-core-4.4.3.jar:4.4.3]
	at io.micronaut.http.netty.body.NettyJsonHandler.read(NettyJsonHandler.java:129) ~[micronaut-http-netty-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.FullNettyClientHttpResponse.convertByteBuf(FullNettyClientHttpResponse.java:224) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.FullNettyClientHttpResponse.lambda$getBody$0(FullNettyClientHttpResponse.java:173) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at java.util.HashMap.computeIfAbsent(HashMap.java:1220) ~[?:?]
	at io.micronaut.http.client.netty.FullNettyClientHttpResponse.getBody(FullNettyClientHttpResponse.java:168) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.FullNettyClientHttpResponse.<init>(FullNettyClientHttpResponse.java:107) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.forwardResponseToPromise(DefaultHttpClient.java:2202) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.channelReadInstrumented(DefaultHttpClient.java:2179) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.channelReadInstrumented(DefaultHttpClient.java:2147) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.micronaut.http.client.netty.SimpleChannelInboundHandlerInstrumented.channelRead0(SimpleChannelInboundHandlerInstrumented.java:46) ~[micronaut-http-client-4.4.3.jar:4.4.3]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) [netty-codec-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) [netty-codec-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.micronaut.http.client.netty.ResettableReadTimeoutHandler$NextInterceptor.channelRead(ResettableReadTimeoutHandler.java:92) [micronaut-http-client-4.4.3.jar:4.4.3]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) [netty-handler-4.1.108.Final.jar:4.1.108.Final]
	at io.micronaut.http.client.netty.ResettableReadTimeoutHandler.channelRead(ResettableReadTimeoutHandler.java:64) [micronaut-http-client-4.4.3.jar:4.4.3]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) [netty-transport-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [netty-common-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.108.Final.jar:4.1.108.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.108.Final.jar:4.1.108.Final]
	at java.lang.Thread.run(Thread.java:833) [?:?]

Steps To Reproduce

No response

Environment Information

Windows, JDK 17

Example Application

No response

Version

4.4.0

@nedelva
Copy link
Author

nedelva commented Apr 22, 2024

I am hoping this will go away once this pull request gets merged: #10749

@sdelamo sdelamo added the type: regression A breaking change was introduced in a minor or patch release label May 3, 2024
sdelamo added a commit that referenced this issue May 3, 2024
Close: #10745

Use `managed-jackson` version everywhere.

Use `managed-jackson-databaind` should be removed in Micronaut Framework 5.
@sdelamo
Copy link
Contributor

sdelamo commented May 3, 2024

@nedelva thanks for reporting. I created this PR #10795

@ethanhere
Copy link

#10795 is to use 1 jackson version in micronaut 5. What about micronaut 4? With micronaut-platform 4.4.1, jackson-databind still uses different version than other jackson dependencies. Would that be fixed with micronaut-platform 4.5.x?

@sdelamo
Copy link
Contributor

sdelamo commented May 3, 2024

#10795 is to use 1 jackson version in micronaut 5.

@ethanhere No. that it is not so. That PR will make sure we will use 2.17.0 everywhere. We will release that in Micronaut Core 4.4.9 which will be released in Micronaut Platform 4.4.3.

@ethanhere
Copy link

any idea when Micronaut Platform 4.4.3. would come out?

@sdelamo
Copy link
Contributor

sdelamo commented May 3, 2024

we are releasing Micronaut Platform 4.4.2 today. Typically, 7 - 10 days after we will release the next patch.

A workaround is to force the Jackson Databind version to 2.17.0.

configurations.all {
    resolutionStrategy {
        force "group:artififactid:version"
    }
}

Or you can force core to 4.4.9 once we release it.

@sdelamo
Copy link
Contributor

sdelamo commented May 26, 2024

This should be fixed in Micronaut Framework 4.4.3

@sdelamo sdelamo closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A breaking change was introduced in a minor or patch release
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants