Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Mapping of large numbers fails when using MongoDB #192
When using large numbers as id's for entity objects you get this exception:
Here is the unit test that triggers the bugg:
referenced this issue
Aug 24, 2015
cant reproduce it
Which version of gson and mongo you have in runtime?
I tried with gson 2.2.4 but the test still fails. We use MongoDB 3.0.5 on windows.
I need to reproduce the error on my laptop.
I've pushed new test ("should support long number as Entity Id") for this case to master
added a commit
Nov 25, 2015
I discovered that mongo persists different json documents:
and when Gson tries to deserialize the first object it expects number but there is:
and that's why it finished with
java.lang.IllegalStateException: Expected NUMBER but was BEGIN_OBJECT
I will try to go deeper and solve this problem :)
Bug is fixed in version 1.4.0-RC2 http://search.maven.org/#artifactdetails|org.javers|javers-core|1.4.0-RC2|jar