Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0045359 | Retail Modules | Web POS | public | 2020-11-02 18:22 | 2020-11-19 08:06 |
Reporter | aaroncalero | ||||
Assigned To | prakashmurugesan88 | ||||
Priority | high | Severity | major | Reproducibility | random |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | RR21Q1 | |||
Merge Request Status | approved | ||||
Review Assigned To | |||||
OBNetwork customer | Gold | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0045359: Static Dateformatter in JSONPropertyToEntity.java can cause random errors if accessed simultaneously | ||||
Description | Java DateFormatters are not thread-safe, so when a formatter is defined as static and accessed simultaneously, it can behave incorrectly. There is a static DateFormatter in JSONPropertyToEntity, which is in charge of parsing json objects to set properties to entities. If this class is invoked from two different threads, and two date properties are processed at the same time, one of them could fail. | ||||
Steps To Reproduce | It is not possible to reproduce this manually, but we have seen the following error in a client environment: 2020-11-01 10:17:58,164 [http-11] ERROR org.openbravo.retail.posterminal.CustomerAddrLoader - Exception while updating BPartner Address java.lang.NumberFormatException: For input string: "2020-10-03T14:20:42+02:00" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_232] at java.lang.Long.parseLong(Long.java:589) ~[?:1.8.0_232] at java.lang.Long.valueOf(Long.java:803) ~[?:1.8.0_232] at org.openbravo.mobile.core.process.JSONPropertyToEntity.fillBobFromJSON(JSONPropertyToEntity.java:113) ~[classes/:?] at org.openbravo.mobile.core.process.JSONPropertyToEntity.fillBobFromJSON(JSONPropertyToEntity.java:37) ~[classes/:?] at org.openbravo.retail.posterminal.CustomerAddrLoader.editBPartnerAddr(CustomerAddrLoader.java:191) [classes/:?] | ||||
Proposed Solution | The static modifier here[1] should be removed, and a new dateFormatter instance should be created each time it is needed. [1] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/src/org/openbravo/mobile/core/process/JSONPropertyToEntity.java#L33 [^] Examples of other issues where the same fix was applied: 0040474, 0040934 | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2020-11-02 18:22 | aaroncalero | New Issue | |||
2020-11-02 18:22 | aaroncalero | Assigned To | => Retail | ||
2020-11-02 18:22 | aaroncalero | OBNetwork customer | => Gold | ||
2020-11-02 18:22 | aaroncalero | Resolution time | => 1606086000 | ||
2020-11-02 18:22 | aaroncalero | Triggers an Emergency Pack | => No | ||
2020-11-19 06:10 | prakashmurugesan88 | Assigned To | Retail => prakashmurugesan88 | ||
2020-11-19 06:10 | prakashmurugesan88 | Status | new => scheduled | ||
2020-11-19 06:53 | hgbot | Merge Request Status | => open | ||
2020-11-19 06:53 | hgbot | Note Added: 0124499 | |||
2020-11-19 08:06 | hgbot | Merge Request Status | open => approved | ||
2020-11-19 08:06 | hgbot | Resolution | open => fixed | ||
2020-11-19 08:06 | hgbot | Status | scheduled => closed | ||
2020-11-19 08:06 | hgbot | Note Added: 0124500 | |||
2020-11-19 08:06 | hgbot | Fixed in Version | => RR21Q1 | ||
2020-11-19 08:06 | hgbot | Note Added: 0124501 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|