Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027225Retail ModulesWeb POSpublic2014-07-29 08:372014-11-16 22:01
mtaal 
marvintm 
normalmajorhave not tried
closedfixed 
5
 
RR15Q1 
mtaal
No
0027225: ProcessCashClose: Infinite loop/stackoverflow when there are reconcilliations in draft mode
When there are reconcilliations in draft mode the process cash close (ProcessCashClose class) reports an error. The way this is done results in an infinite loop as one jsonobject (the jsonresponse in the code) is set in itself resulting in an infinite loop when doing to String.

See the stack trace in the steps to reproduce.

Note that it seems that the admin mode is not handled correctly in this case either.

The attached diff solves the stackoverflow but not the admin mode topic
- Create manually a reconcilliations for a pos payment method for one of the pos terminals
- in that terminal create a ticket and do a cashup

You will get the following stack trace:
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
        at org.codehaus.jettison.json.JSONObject.toString(JSONObject.java:1038)
        at org.codehaus.jettison.json.JSONObject.valueToString(JSONObject.java:1159)
fff0bb6f 2014-07-29 02:34:32,797 [ajp-8809-5] WARN org.openbravo.dal.core.OBContext - Unbalanced calls to setAdminMode and restorePreviousMode. Consider setting the constant OBContext.ADMIN_TRACE_SIZE to a value higher than 0 to debug this situation
No tags attached.
related to defect 0026942 closed marvintm Cash up process doesn't work correctly in case a reconciliation in draft status exists in the system 
related to defect 0027394 closed marvintm Cash up process doesn't work correctly in case a reconciliation in draft status exists in the system 
patch 27225.patch (1,111) 2014-07-29 08:40
https://issues.openbravo.com/file_download.php?file_id=7102&type=bug
diff issue-27225-retailq2.2.diff (1,308) 2014-07-29 08:57
https://issues.openbravo.com/file_download.php?file_id=7103&type=bug
Issue History
2014-07-29 08:37mtaalNew Issue
2014-07-29 08:37mtaalAssigned To => marvintm
2014-07-29 08:37mtaalTriggers an Emergency Pack => No
2014-07-29 08:40mtaalFile Added: 27225.patch
2014-07-29 08:57mtaalFile Added: issue-27225-retailq2.2.diff
2014-07-29 08:58mtaalNote Added: 0068946
2014-08-29 15:01mtaalRelationship addedrelated to 0026942
2014-08-29 15:02mtaalRelationship addedrelated to 0027394
2014-11-11 18:00mtaalTarget VersionRR14Q3 => RR15Q1
2014-11-16 22:00mtaalStatusnew => scheduled
2014-11-16 22:00mtaalNote Added: 0071673
2014-11-16 22:00mtaalfix_in_branch => pi
2014-11-16 22:01mtaalNote Added: 0071674
2014-11-16 22:01mtaalStatusscheduled => resolved
2014-11-16 22:01mtaalResolutionopen => fixed
2014-11-16 22:01mtaalReview Assigned To => mtaal
2014-11-16 22:01mtaalNote Added: 0071675
2014-11-16 22:01mtaalStatusresolved => closed

Notes
(0068946)
mtaal   
2014-07-29 08:58   
The second diff is patching on 2014 q2.2 release.
(0071673)
mtaal   
2014-11-16 22:00   
.
(0071674)
mtaal   
2014-11-16 22:01   
Patch works fine at Grape customer for months now
(0071675)
mtaal   
2014-11-16 22:01   
Patch works fine at Grape customer for months now