Openbravo Issue Tracking System - Retail Modules | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0040474 | Retail Modules | Sessions | public | 2019-03-28 11:05 | 2019-05-22 10:40 | |||||||
Reporter | aaroncalero | |||||||||||
Assigned To | ranjith_qualiantech_com | |||||||||||
Priority | high | Severity | major | Reproducibility | random | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | RR19Q3 | ||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | adrianromero | |||||||||||
OBNetwork customer | Gold | |||||||||||
Support ticket | 9186 | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0040474: [Sessions] Completing multiple cashups simultaneously can cause NumberFormatExceptions | |||||||||||
Description | With the Sessions module installed, completing multiple cashups at the same time (which can happen in a production environment when all terminales close the cashups at the same time) can lead to NumberFormatException thrown in the server, leaving some of the cashups in the Errors While Importing POS Data window, with the following error*: java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:601) at java.lang.Long.parseLong(Long.java:631) at java.text.DigitList.getLong(DigitList.java:195) at java.text.DecimalFormat.parse(DecimalFormat.java:2051) at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869) at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514) at java.text.DateFormat.parse(DateFormat.java:364) at org.openbravo.retail.sessions.CloseSessionHook.exec(CloseSessionHook.java:33) at org.openbravo.retail.posterminal.CashCloseProcessor.executeHooks(CashCloseProcessor.java:185) at org.openbravo.retail.posterminal.CashCloseProcessor.processCashClose(CashCloseProcessor.java:160) * The NumberFormatException can vary (or the parsed date can be simply wrong): java.lang.NumberFormatException: For input string: "" java.lang.NumberFormatException: multiple points java.lang.NumberFormatException: empty String | |||||||||||
Steps To Reproduce | it is really hard to reproduce the issue manually/with an automated test, but the problem can be simulated using the attached patch. The attached patch replicates the code found in the CloseSessionHook file[1], a static SimpleDateFormat and multiple accesses to its parse method. 1. Apply the patch, compile the application and start the server 2. Login in backend 3. Click on Help > About. 4. Verify in the server log that some exceptions are shown, and that the date has been parsed wrongly in some cases. [1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/file/tip/src/org/openbravo/retail/sessions/CloseSessionHook.java [^] | |||||||||||
Proposed Solution | In the CloseSessionHook.java file the static modifier of the date formatter should be removed. | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=12800&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=12810&type=bug | |||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2019-03-28 11:05 | aaroncalero | New Issue | ||||||||||
2019-03-28 11:05 | aaroncalero | Assigned To | => Retail | |||||||||
2019-03-28 11:05 | aaroncalero | File Added: SimulateNumberFormatException.diff | ||||||||||
2019-03-28 11:05 | aaroncalero | OBNetwork customer | => Gold | |||||||||
2019-03-28 11:05 | aaroncalero | Resolution time | => 1554933600 | |||||||||
2019-03-28 11:05 | aaroncalero | Triggers an Emergency Pack | => No | |||||||||
2019-03-28 12:20 | ranjith_qualiantech_com | Assigned To | Retail => ranjith_qualiantech_com | |||||||||
2019-03-29 11:17 | ranjith_qualiantech_com | Status | new => scheduled | |||||||||
2019-03-29 11:24 | ranjith_qualiantech_com | File Added: issue 40474 source sessions.patch | ||||||||||
2019-04-04 10:01 | ngarcia | Issue Monitored: ngarcia | ||||||||||
2019-04-04 11:01 | ngarcia | Support ticket | => 9186 | |||||||||
2019-04-05 08:43 | hgbot | Checkin | ||||||||||
2019-04-05 08:43 | hgbot | Note Added: 0110985 | ||||||||||
2019-04-07 08:30 | ranjith_qualiantech_com | Status | scheduled => resolved | |||||||||
2019-04-07 08:30 | ranjith_qualiantech_com | Resolution | open => fixed | |||||||||
2019-04-15 12:31 | adrianromero | Note Added: 0111126 | ||||||||||
2019-04-15 12:31 | adrianromero | Status | resolved => new | |||||||||
2019-04-15 12:31 | adrianromero | Resolution | fixed => open | |||||||||
2019-04-15 12:47 | ranjith_qualiantech_com | Status | new => scheduled | |||||||||
2019-04-15 12:49 | hgbot | Checkin | ||||||||||
2019-04-15 12:49 | hgbot | Note Added: 0111130 | ||||||||||
2019-04-15 12:49 | hgbot | Status | scheduled => resolved | |||||||||
2019-04-15 12:49 | hgbot | Resolution | open => fixed | |||||||||
2019-04-15 12:49 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/7a3c2345e928587fcc716b25c130fe8405416910 [^] | |||||||||
2019-04-15 13:15 | adrianromero | Review Assigned To | => adrianromero | |||||||||
2019-04-15 13:15 | adrianromero | Note Added: 0111133 | ||||||||||
2019-04-15 13:15 | adrianromero | Status | resolved => closed | |||||||||
2019-04-15 13:15 | adrianromero | Fixed in Version | => RR19Q3 | |||||||||
2019-05-22 10:40 | ngarcia | Issue cloned | 0040934 | |||||||||
2019-05-22 10:40 | ngarcia | Relationship added | related to 0040934 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|