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

Error deserializing pojo with multi-map when guava and scala modules are used #95

Closed
ittaiz opened this issue Aug 7, 2013 · 11 comments
Closed
Milestone

Comments

@ittaiz
Copy link

ittaiz commented Aug 7, 2013

As you can see in the following gist if scala module is defined after guava module then there is an error deserializing a pojo with a multi-map property.
Not sure if the bug is in the scala module or guava module so I'm opening the same ticket on both and I'd appreciate you figuring out who is at fault here.

https://gist.github.com/ittaiz/6174553

issue on guava-module: FasterXML/jackson-datatype-guava#26

@ittaiz
Copy link
Author

ittaiz commented Aug 8, 2013

Forgot to add that I think the problem is that when the objectMapper tries to decide on the deserializer it grabs one that scala-module sets and not that of guava-module and therefore tries to deser it as a map:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_ARRAY token
at [Source: N/A; line: -1, column: -1]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:575)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:46)
at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringMap(MapDeserializer.java:432)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:314)
at com.fasterxml.jackson.module.scala.deser.UnsortedMapDeserializer.deserialize(UnsortedMapDeserializerModule.scala:74)
at com.fasterxml.jackson.module.scala.deser.UnsortedMapDeserializer.deserialize(UnsortedMapDeserializerModule.scala:38)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:464)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:347)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:977)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:276)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1179)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:635)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:698)
at com.wixpress.report.JacksonMultiMapTest.blowsUpWhenScalaIsSecond(JacksonMultiMapTest.scala:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

@christophercurrie
Copy link
Member

It's a safe guess that the issue is on the Scala module side. I'll look at it as soon as possible.

@ittaiz
Copy link
Author

ittaiz commented Aug 19, 2013

Hi,
Any update?
If not then maybe a rough rough estimate on whether you'll get around to it sometime soon?
Thanks

@christophercurrie
Copy link
Member

I have not had a chance to look at this yet. When it is fixed, it will go out as an update that is coordinated with Jackson 2.2.3, which has not been scheduled yet. I would monitor the Jackson User list for updates on the next release.

christophercurrie added a commit that referenced this issue Aug 23, 2013
@christophercurrie
Copy link
Member

Really surprised I didn't see more failures due to this bug. Ended up being a small hidden defect in Map serializer resolution. Fix should go out in 2.2.3.

@ittaiz
Copy link
Author

ittaiz commented Aug 23, 2013

Thanks! Any idea when 2.2.3 will come out?

@cowtowncoder
Copy link
Member

We have started pushing 2.2.3 out; core components and data-format modules done, datatypes and Scala still to be released. So within couple of days I hope.

@ittaiz
Copy link
Author

ittaiz commented Aug 26, 2013

Thanks for the update 👍

@ittaiz
Copy link
Author

ittaiz commented Sep 8, 2013

Any update when it will be in maven central? I see the tag in the repo but not the artifact in central

@christophercurrie
Copy link
Member

There is an outstanding issue identified by another user that I hope to resolve (and update the tag) before release. Resolved or not, the release should go out some time Monday.

@ittaiz
Copy link
Author

ittaiz commented Sep 8, 2013

Oh, ok.
Thanks for the update; the tag just confused me.

בתאריך יום ראשון, 8 בספטמבר 2013, Christopher Currie כתב:

There is an outstanding issue identified by another user that I hope to
resolve (and update the tag) before release. Resolved or not, the release
should go out some time Monday.


Reply to this email directly or view it on GitHubhttps://github.com//issues/95#issuecomment-24025767
.

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

3 participants