Closed IgorMaksymov closed 6 years ago
I have the same problem.
Any ideas to fix this error?
Hi @IgorMaksymov ,
To what I have seen at the moment, it seems that the problem is for the com.fasterxml.jackson.core:jackson-databind:2.9.4 library.
For the moment to bypass the error I have forced the use of the com.fasterxml.jackson.core:jackson-databind:2.9.3 library.
@CarlosLoboZamarro thanks! In your explanation conflict and fix versions are the same. @jamesdbloom could you fix this issue? Because spring boot 2 provides this jackson dependency and its not good to exclude it from parent
Sorry @IgorMaksymov ,
I wanted to say com.fasterxml.jackson.core:jackson-databind:2.9.3 library.
For more data, here's the code that di thrown an error for me :
oauthServer.when(
request("/oauth/v2/access_token")
.withMethod("GET")
.withHeader("X-Correlation-Id", "70b10973-a064-41da-8a5b-5a4dacca9d15")
.withQueryStringParameter("grant_type", "client_credentials")
.withQueryStringParameter("scope", "SCOPE")
.withHeader("authorization", "Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0"))
.respond(response().withStatusCode(200)
.withBody("{\"access_token\":\"the_great_access_token\",\"expires_in\":1000}"));
Upon debugging the deserializer complains about deserializing this array "grant_type" : [ "client_credentials" ]
.
Here's a whole stack trace :
11:44:53.828 [tLoopGroup-19-2] ERROR o.m.c.serialization.ExpectationSerializer:73 - Exception while parsing [{
"httpRequest" : {
"method" : "GET",
"path" : "/oauth/v2/access_token",
"queryStringParameters" : {
"grant_type" : [ "client_credentials" ],
"scope" : [ "SCOPE" ]
},
"headers" : {
"X-Correlation-Id" : [ "70b10973-a064-41da-8a5b-5a4dacca9d15" ],
"authorization" : [ "Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0" ]
}
},
"httpResponse" : {
"statusCode" : 200,
"body" : "{\"access_token\":\"the_great_access_token\",\"expires_in\":1000}"
},
"times" : {
"remainingTimes" : 0,
"unlimited" : true
},
"timeToLive" : {
"unlimited" : true
}
}] for Expectation
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of FIELD_NAME token
at [Source: (String)"{
"httpRequest" : {
"method" : "GET",
"path" : "/oauth/v2/access_token",
"queryStringParameters" : {
"grant_type" : [ "client_credentials" ],
"scope" : [ "SCOPE" ]
},
"headers" : {
"X-Correlation-Id" : [ "70b10973-a064-41da-8a5b-5a4dacca9d15" ],
"authorization" : [ "Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0" ]
}
},
"httpResponse" : {
"statusCode" : 200,
"body" : "{\"access_token\":\"the_great_access_token\",\"expires_in\":1000}"
},
"time"[truncated 108 chars]; line: 6, column: 7] (through reference chain: org.mockserver.client.serialization.model.ExpectationDTO["httpRequest"]->org.mockserver.client.serialization.model.HttpRequestDTO["queryStringParameters"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:759)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:746)
at org.mockserver.client.serialization.deserializers.string.NottableStringDeserializer.deserialize(NottableStringDeserializer.java:44)
at org.mockserver.client.serialization.deserializers.string.NottableStringDeserializer.deserialize(NottableStringDeserializer.java:19)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:759)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:746)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserializeObject(KeysToMultiValuesDeserializer.java:48)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserialize(KeysToMultiValuesDeserializer.java:35)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserialize(KeysToMultiValuesDeserializer.java:22)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992)
at org.mockserver.client.serialization.ExpectationSerializer.deserialize(ExpectationSerializer.java:68)
at org.mockserver.client.serialization.ExpectationSerializer.deserializeArray(ExpectationSerializer.java:101)
at org.mockserver.mock.HttpStateHandler.handle(HttpStateHandler.java:218)
at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:64)
at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:37)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.mockserver.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:188)
at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:91)
at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:37)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:934)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
12:09:06.416 [ntLoopGroup-3-2] ERROR org.mockserver.logging.LoggingFormatter:52 - Exception processing {
"method" : "PUT",
"path" : "/expectation",
"headers" : {
"host" : [ "localhost:50094" ],
"accept-encoding" : [ "gzip,deflate" ],
"content-length" : [ "608" ],
"connection" : [ "keep-alive" ],
"content-type" : [ "text/plain; charset=utf-8" ]
},
"keepAlive" : true,
"secure" : false,
"body" : {
"type" : "STRING",
"string" : "{\n \"httpRequest\" : {\n \"method\" : \"GET\",\n \"path\" : \"/oauth/v2/access_token\",\n \"queryStringParameters\" : {\n \"grant_type\" : [ \"client_credentials\" ],\n \"scope\" : [ \"SCOPE\" ]\n },\n \"headers\" : {\n \"X-Correlation-Id\" : [ \"31214398-0a07-443f-9d7d-299b2a9d1946\" ],\n \"authorization\" : [ \"Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0\" ]\n }\n },\n \"httpResponse\" : {\n \"statusCode\" : 200,\n \"body\" : \"{\\\"access_token\\\":\\\"the_great_access_token\\\",\\\"expires_in\\\":1000}\"\n },\n \"times\" : {\n \"remainingTimes\" : 0,\n \"unlimited\" : true\n },\n \"timeToLive\" : {\n \"unlimited\" : true\n }\n}",
"contentType" : "text/plain; charset=utf-8"
}
}
java.lang.RuntimeException: Exception while parsing [{
"httpRequest" : {
"method" : "GET",
"path" : "/oauth/v2/access_token",
"queryStringParameters" : {
"grant_type" : [ "client_credentials" ],
"scope" : [ "SCOPE" ]
},
"headers" : {
"X-Correlation-Id" : [ "31214398-0a07-443f-9d7d-299b2a9d1946" ],
"authorization" : [ "Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0" ]
}
},
"httpResponse" : {
"statusCode" : 200,
"body" : "{\"access_token\":\"the_great_access_token\",\"expires_in\":1000}"
},
"times" : {
"remainingTimes" : 0,
"unlimited" : true
},
"timeToLive" : {
"unlimited" : true
}
}] for Expectation
at org.mockserver.client.serialization.ExpectationSerializer.deserialize(ExpectationSerializer.java:74)
at org.mockserver.client.serialization.ExpectationSerializer.deserializeArray(ExpectationSerializer.java:101)
at org.mockserver.mock.HttpStateHandler.handle(HttpStateHandler.java:218)
at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:64)
at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:37)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.mockserver.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:188)
at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:91)
at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:37)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1342)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:934)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of FIELD_NAME token
at [Source: (String)"{
"httpRequest" : {
"method" : "GET",
"path" : "/oauth/v2/access_token",
"queryStringParameters" : {
"grant_type" : [ "client_credentials" ],
"scope" : [ "SCOPE" ]
},
"headers" : {
"X-Correlation-Id" : [ "31214398-0a07-443f-9d7d-299b2a9d1946" ],
"authorization" : [ "Basic Y2xpZW50SWQ6Y2xpZW50U2VjcmV0" ]
}
},
"httpResponse" : {
"statusCode" : 200,
"body" : "{\"access_token\":\"the_great_access_token\",\"expires_in\":1000}"
},
"time"[truncated 108 chars]; line: 6, column: 7] (through reference chain: org.mockserver.client.serialization.model.ExpectationDTO["httpRequest"]->org.mockserver.client.serialization.model.HttpRequestDTO["queryStringParameters"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:759)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:746)
at org.mockserver.client.serialization.deserializers.string.NottableStringDeserializer.deserialize(NottableStringDeserializer.java:44)
at org.mockserver.client.serialization.deserializers.string.NottableStringDeserializer.deserialize(NottableStringDeserializer.java:19)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:759)
at com.fasterxml.jackson.databind.DeserializationContext.readValue(DeserializationContext.java:746)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserializeObject(KeysToMultiValuesDeserializer.java:48)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserialize(KeysToMultiValuesDeserializer.java:35)
at org.mockserver.client.serialization.deserializers.collections.KeysToMultiValuesDeserializer.deserialize(KeysToMultiValuesDeserializer.java:22)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
...
Here's what changed with jackson-databind 2.9.4 : https://github.com/FasterXML/jackson-databind/blob/jackson-databind-2.9.5/release-notes/VERSION-2.x#L31-L61
I wonder if this was introduced by this issue / change https://github.com/FasterXML/jackson-databind/issues/1853
I used version 5.1.1 and it worked.
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-client-java</artifactId>
<version>5.1.1</version>
</dependency>
Also fails for jackson 2.8.11, which is a hotfix for a CVE. And the issue is gone in 2.9.2 (which doesn't have a hotfix for the CVE), and then fails again in 2.9.5. I didn't try 2.9.3 or 2.9.4 yet though. But the hotfix in 2.8.11 may be a clue.
Jackson 2.9.3 does work fine, as mentioned here previously.
Agreed, 2.9.3 does work. 2.9.4 doesn't.
2.9.5 doesn't work either. Same error as 2.9.4
There is a bug in Jackson from version 2.9.4 onwards. The bug is because Jackson invalidly prevents deserialisation of JSON fields names for objects unless those objects are deserialised as a Map.
I have however worked around this bug with d267a2d5bc7f1b48abdf7ade0457244c7761d595.
@jamesbloomnektan Do you have the jackson issue ticket ?
@jamesbloomnektan Did your fix get released to maven central yet?
Version 5.4.1 is available on maven central
On Mon, Jul 2, 2018, 21:29 Nathan notifications@github.com wrote:
@jamesbloomnektan https://github.com/jamesbloomnektan Did your fix get released to maven yet?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamesdbloom/mockserver/issues/451#issuecomment-401893466, or mute the thread https://github.com/notifications/unsubscribe-auth/Aas2ydyFBKBvFqVV7Wp5my4RO0Mi0vp8ks5uCmaCgaJpZM4SsKUp .
Works great! Thanks
(Side note: You changed the names of some methods without having some deprecation period. I was on 5.3.0 and the method callback
existed, now its called respond
. That kind of change without a @Deprecated
warning is kind of annoying)
Is there plans to update the mockserver maven plugin soon to use the latest version and to pull in this fix?
i'm trying to send
application/x-www-form-urlencoded
request with bodyto:email@email.com
this is the test code:
new MockServerClient("localhost", 1080) .when(request("/messages") .withMethod("POST") .withQueryStringParameter(Parameter.param("to","email@email.com")) ) .respond(response().withStatusCode(200));
And when this code is executed, i have this exception:IllegalArgumentException: Exception while parsing [{ "httpRequest" : { "method" : "POST", "path" : "/messages", "queryStringParameters" : { "to" : [ "email@email.com" ] } }, "httpResponse" : { "statusCode" : 200 }, "times" : { "remainingTimes" : 0, "unlimited" : true }, "timeToLive" : { "unlimited" : true } }] for Expectation
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of
java.lang.Stringout of FIELD_NAME token at [Source: (String)"{ "httpRequest" : { "method" : "POST", "path" : "/messages", "queryStringParameters" : { "to" : [ "email@email.com" ] } }, "httpResponse" : { "statusCode" : 200 }, "times" : { "remainingTimes" : 0, "unlimited" : true }, "timeToLive" : { "unlimited" : true } }"
How can i bypass or fix this?