Question

I am trying to insert into mongo DB and am getting the following error when I try and insert a joda big money object

"can't serialize class org.joda.money.BigMoney"

however according to the java doc BigMoney does implement serializable ( http://www.joda.org/joda-money/apidocs/org/joda/money/BigMoney.html )

Why would this error occur when serializable is implemented?

No correct solution

OTHER TIPS

The Java driver can only serialise simple primitive types not complex ones - it's not using Java serialisation.

If you want to use Joda money you'll have to do the conversion yourself from the BigMoney object into one (or likely more) primitive values that the driver understands.

This will get a lot easier in the 3.x version of the driver, but for now those are your options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top