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
MalformedInputException on valid BSON. #33
Comments
Without test data this is going to be a tough one. MalformedInputException usually means the string contains invalid characters (in this case invalid for UTF-8). Can you confirm this? Would it be possible to provide a test file that contains only this specific string? Cheers, |
I'm about to release a new version of bson4jackson that is compatible to Jackson 2.3. I will close this issue due to inactivity. If you get to reproduce the problem with data that can be shared feel free to open the issue again. Thanks, |
Hi, Someone has described same behavior on Jongo ML : https://groups.google.com/forum/?fromgroups=#!topic/jongo-user/Lj8bvsBjEao I was able to reproduce the bug described in this issue with bson4jackson 2.3.0 using the content.txt (json file) provided into the post. |
Probably related to something like http://stackoverflow.com/questions/14381704/the-type-generates-a-string-that-requires-more-than-65535-bytes-to-encode-in-utf |
Hi @michel-kraemer, can this issue be reopened ? |
@bguerout I'm sorry for the late answer. End of the year is always a busy time at the office! :-/ I'll try to investigate the issue later today or tomorrow. If it can be reproduced, it can be fixed! |
No problem, i know what you are talking about :-) |
The commit I just uploaded should fix the problem. Can you please test it and report if the problem persists? Building bson4jackson should be as simple as running |
Indeed this is fixed. |
Thanks for the feedback. If you need a new version just let me know. |
Thanks! Whenever you release a new version (to maven), I can easily check to see if my case is fixed as well. |
Version 2.3.1 has just been released. Should be available at Maven central in a couple of minutes. Cheers, |
Sorry for the delay, but 2.3.1 does indeed fix the issue I was hitting. Thanks very much! |
Hitting a MalformedInputException on a particular bson file. Unfortunately, I can't share it since it has customer data in it. The BSON seems to be valid (bsondump has no problem with it). I'll try to dig in deeper when I get a chance, but logging an issue in case it's useful.
Exception in thread "main" java.lang.RuntimeException: Input length = 1
at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:124)
at scala.collection.JavaConversions$JIteratorWrapper.next(JavaConversions.scala:575)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
at bson2json.App$.main(App.scala:37)
at bson2json.App.main(App.scala)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:277)
at de.undercouch.bson4jackson.io.LittleEndianInputStream.readUTF(LittleEndianInputStream.java:293)
at de.undercouch.bson4jackson.io.LittleEndianInputStream.readUTF(LittleEndianInputStream.java:227)
at de.undercouch.bson4jackson.BsonParser.readString(BsonParser.java:570)
at de.undercouch.bson4jackson.BsonParser.nextToken(BsonParser.java:292)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringMap(MapDeserializer.java:422)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:314)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:26)
at com.fasterxml.jackson.databind.MappingIterator.nextValue(MappingIterator.java:189)
at com.fasterxml.jackson.databind.MappingIterator.next(MappingIterator.java:120)
... 5 more
The text was updated successfully, but these errors were encountered: