Forums Register Login

java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal

+Pie Number of slices to send: Send
I am getting a BigDecimal Through a getter method and putting that into a Map<String,Object[]>
that bigdecimal is part of the Object[] Array.
but i am getting this ClassCastException.

While fetching that array value and setting into Object[]
Map<String,Object[]> map=HashMap<String,Object[]>();
map.put("1",new Object[] { l_obj.getValueOfBigDecimal()})
I am getting this Execption.

Can anyBody help?
+Pie Number of slices to send: Send
Can you show the full stacktrace please? That will give us a better idea as to where the problem is occurring. I suspect there is an issue with your get method.
+Pie Number of slices to send: Send
Are you putting the BigDecimal object into the Object[] or into the Map?
+Pie Number of slices to send: Send
yes..i am putting BigDecimal into Object[] ar. and Object[] ar i am putting into Map.
+Pie Number of slices to send: Send
But the exception would be thrown when you are getting the data out of the map, so why aren't we seeing that code? James Boswell asked you to post it quite a long time ago.
See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 7748 times.
Similar Threads
Arithmetic operations with large numbers
Convert String to BigDecimal
Iterating a hashmap in jsp using struts2
Getting SOAPMessage as null
Not seeing properties in JSP
Thread Boost feature
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:50:14.