문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top