I\'m getting the following exception.
Caused by:
java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
You can try this:
((BigDecimal) volume).intValue();
I use java.math.BigDecimal convert to int (primitive type).
java.math.BigDecimal
int
It is worked for me.