XDMP-RANGEINDEX Error for decimal properties value saved via the Java API

Solution 1:

It turns out if you add the property as a BigDecimal instead of a Double it gets serialized correctly.

Changing metadataHandle.withProperty("TotalObligatedAmount",Double.valueOf(18912626.00)); to metadataHandle.withProperty("TotalObligatedAmount",new BigDecimal(18912626.00)); was enough to make the code work.