Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033718Retail ModulesStoreServerpublic2016-08-16 02:422016-09-05 13:31
mtaal 
mtaal 
normalminorhave not tried
closedfixed 
5
 
RR16Q4 
AugustoMauch
No
0033718: NPE in Synchronized Process Caller if DataSynchronizationProcess does not define a valid DataSynchronization annotation
Normally a DataSynchronizationProcess class has a DataSynchronization annotation (like [1]). However there is also code where this is not the case because that code does not need it directly (like [2]). This can result in a NPE to be thrown like in [3].

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/ebf194422e27/src/org/openbravo/retail/posterminal/OrderLoader.java#l103 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/file/f620926094c0/src/org/openbravo/retail/sessions/SetBusinessDate.java#l28 [^]

[3]
java.lang.NullPointerException
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.getEntity(DataSynchronizationProcess.java:387)
    at org.openbravo.mobile.core.servercontroller.SynchronizedServerProcessCaller.afterReturnFromCentral(SynchronizedServerProcessCaller.java:141)
    at org.openbravo.mobile.core.servercontroller.MultiServerJSONProcess.executeFromWebPOSInStore(MultiServerJSONProcess.java:361)
    at org.openbravo.mobile.core.servercontroller.MultiServerJSONProcess.exec(MultiServerJSONProcess.java:162)
    at org.openbravo.mobile.core.process.JSONProcessSimple.exec(JSONProcessSimple.java:59)
    at org.openbravo.mobile.core.process.SecuredJSONProcess.secureExec(SecuredJSONProcess.java:56)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execProcess(MobileServiceProcessor.java:117)
    at org.openbravo.mobile.core.process.MobileServiceProcessor.execServiceName(MobileServiceProcessor.java:79)
Install multi-server with the retail.session module
Open a store/till
Set business date --> NPE
Add code to robustly handle this case
No tags attached.
Issue History
2016-08-16 02:42mtaalNew Issue
2016-08-16 02:42mtaalAssigned To => mtaal
2016-08-16 02:42mtaalTriggers an Emergency Pack => No
2016-08-16 04:26hgbotCheckin
2016-08-16 04:26hgbotNote Added: 0089113
2016-08-16 04:26hgbotStatusnew => resolved
2016-08-16 04:26hgbotResolutionopen => fixed
2016-08-16 04:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/945ed441fffae5c0bab970cef1ec13e9f47d7a51 [^]
2016-08-16 10:47mtaalReview Assigned To => AugustoMauch
2016-08-24 09:20AugustoMauchNote Added: 0089329
2016-08-24 09:20AugustoMauchStatusresolved => new
2016-08-24 09:20AugustoMauchResolutionfixed => open
2016-08-30 22:16hgbotCheckin
2016-08-30 22:16hgbotNote Added: 0089563
2016-08-30 22:16hgbotStatusnew => resolved
2016-08-30 22:16hgbotResolutionopen => fixed
2016-08-30 22:16hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/945ed441fffae5c0bab970cef1ec13e9f47d7a51 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/16bb47434364bfabecf52db0c1aeb98ff55c5666 [^]
2016-09-05 13:31AugustoMauchNote Added: 0089756
2016-09-05 13:31AugustoMauchStatusresolved => closed

Notes
(0089113)
hgbot   
2016-08-16 04:26   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 945ed441fffae5c0bab970cef1ec13e9f47d7a51
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 16 04:26:12 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/945ed441fffae5c0bab970cef1ec13e9f47d7a51 [^]

Fixes issue 33718: NPE in Synchronized Process Caller if DataSynchronizationProcess does not define a valid DataSynchronization annotation
Prevent the NPE by checking if the annotation exists and return null if not

---
M src/org/openbravo/mobile/core/process/DataSynchronizationProcess.java
M src/org/openbravo/mobile/core/servercontroller/SynchronizedServerProcessCaller.java
---
(0089329)
AugustoMauch   
2016-08-24 09:20   
Use continue instead of return to process the rest of processors

See line #20 at [1]

[1] https://docs.google.com/spreadsheets/d/1DgowL4n6tbRFMch7duxbmWMTHePOlCoE8iCkbnPPeSg/edit#gid=0 [^]
(0089563)
hgbot   
2016-08-30 22:16   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 16bb47434364bfabecf52db0c1aeb98ff55c5666
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 30 22:16:04 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/16bb47434364bfabecf52db0c1aeb98ff55c5666 [^]

Fixes issue 33849: Infinite loop when exception in SynchronizedServerProcessCaller.afterReturnFromCentra
Fixes issue 33718: NPE in Synchronized Process Caller if DataSynchronizationProcess does not define a valid DataSynchronization
Used continue statement (33718), put retries++ after catch block and also try all processors

---
M src/org/openbravo/mobile/core/servercontroller/SynchronizedServerProcessCaller.java
---
(0089756)
AugustoMauch   
2016-09-05 13:31   
Code reviewed and verified in [1]@85572744adce

[1] https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core [^]