This content has been marked as final. Show 1 reply
922963 wrote:Hi Henry,
I implemented an EntryProcessor to return results of calculated sums, however, below exception is thrown when retrieving the result. Any idea? I tried to amend to return BigDecimal instead of BigDecimal, it does work. Why?
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.math.BigDecimal;
BigDecimal results = (BigDecimal)CacheHelper.getCounterPartyCache().invoke(new FttCntptId("052753"), new CreateOrderProcessor());
it can return arrays, but it can't properly return typed arrays.
At client side that array was deserialized as an Object and not as a BigDecimal and therefore it could not be cast to BigDecimal.
So just change the declaration of the results variable to Object, and do the cast on the elements instead.