ArithmeticException Or IllegalStateException With Infinite Decimal Value Into POF Object (Doc ID 754502.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle Coherence - Version 3.4.0 and later
Information in this document applies to any platform.

Symptoms

Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result

or

Exception in thread "main" java.lang.IllegalStateException: decimal value exceeds IEEE754r 128-bit range

will be thrown when storing a BigDecimal attribute with and indefinite precision using POF serialization with code like the following.

NamedCache cache = CacheFactory.getCache("test");
BigDecimal bd = new BigDecimal(1.0).devide(new BigDecimal(3.0));
// or BigDecimal bd = new BigDecimal(1.0/3.0);

// PofBigDecimal implements PortableObject
PofBigDecimal pbd = new PofBigDecimal(bd);
cache.put(1, pbd);





Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms