[jira] [Commented] (OFBIZ-5927) Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-5927) Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-5927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14256935#comment-14256935 ]

Prateek Ashtikar commented on OFBIZ-5927:
-----------------------------------------

I do agree to what your're saying, but from java coding side, the following line will always create exception because you're assigning a reference of Map request Object to BigDecimal object, when this line is executing catch block on line 727 and showing printstack trace and getting continue there.
BigDecimal amount = (BigDecimal) request.get("x_Amount");

I've debug this issue on my local for Apache OFbiz 13.07.01 and find that when getXAmount(request) method is getting called in processAuthTransResult, processCaptureTransResult etc.., but when I put suggested patch then code is executing fine and there is no catch block is executing. I've seen same problem while executing Void, Refund & Authorization transactions.

I understand its not big issue, but logs showing error related to above mentioned code for most of transactions. Could you please let me know your decision on this issue? Many Thanks.

> Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5927
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5927
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Prateek Ashtikar
>             Fix For: Upcoming Branch, 12.04.06, 13.07.02
>
>
> Issue reported while performing Refund & Void (java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal)
> Change needs to be done in AIMPaymentServices.java. Please look at the following small patch:-
>  
> //BigDecimal amount = (BigDecimal) request.get("x_Amount");
> String newAmt = request.get("x_Amount").toString();
> BigDecimal amount = new BigDecimal(newAmt);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)