What version are you using? (Morphia/Driver/MongoDB)
Morphia 0.99
Please include a stack trace below:
----
java.lang.ClassCastException: [D cannot be cast to [Ljava.lang.Object;
at com.mongodb.util.JSON.serialize(JSON.java:168)
at com.mongodb.util.JSON.serialize(JSON.java:107)
at com.mongodb.util.JSON.serialize(JSON.java:107)
at com.mongodb.util.JSON.serialize(JSON.java:26)
at com.mongodb.BasicDBObject.toString(BasicDBObject.java:71)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at com.google.code.morphia.query.QueryImpl.prepareCursor(QueryImpl.java:170)
at com.google.code.morphia.query.QueryImpl.fetch(QueryImpl.java:206)
at com.google.code.morphia.query.QueryImpl.asList(QueryImpl.java:233)
----
It's because FieldEndImpl.near(double x, double y, boolean spherical) add data
as a `double[] {x, y}`.
But JSON.serialize can accept only arrays of Objects, not primitives.
AS a result, it fails at object casting at JSON.java:168 - `Object[] arr =
(Object[])o`
Original issue reported on code.google.com by igor.art...@gmail.com on 12 Oct 2011 at 11:14
Original issue reported on code.google.com by
igor.art...@gmail.com
on 12 Oct 2011 at 11:14