Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033701Retail ModulesWeb POSpublic2016-08-12 09:552016-08-30 11:22
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR16Q3.1RR16Q3.1 
guilleaer
No
0033701: NPE in POSImportEntryProcessor when the posterminal json property has an illegal value
See stacktrace [1], this causes the import entry from not being saved at all. Change the code [2] to set the status to error and a warning messages.

[1]
Caused by: org.openbravo.base.exception.OBException: java.lang.NullPointerException
        at org.openbravo.mobile.core.process.DataSynchronizationProcess.createImportEntry(DataSynchronizationProcess.java:89)
        at org.openbravo.mobile.core.process.DataSynchronizationProcess.executeCreateImportEntry(DataSynchronizationProcess.java:115)
        ... 41 more
Caused by: java.lang.NullPointerException
        at org.openbravo.retail.posterminal.importprocess.POSImportEntryProcessor.onSave(POSImportEntryProcessor.java:79)
        at sun.reflect.GeneratedMethodAccessor445.invoke(Unknown Source)

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/060b566c4098/src/org/openbravo/retail/posterminal/importprocess/POSImportEntryProcessor.java [^]
Run retail
Put breakpoint in java code in POSImportEntryProcessor
Login to webpos
Do some actions
At breakpoint change the json to set the posTerminalId to the value "null" (note use the string value "null" so not NULL or null)
log warning
set status to Error if no posterminal can be found
No tags attached.
related to design defect 0033555RR16Q4 closed mtaal Prevent query for posterminal in POSImportEntryProcessor 
blocks defect 0033696RR16Q4 closed mtaal NPE in POSImportEntryProcessor when the posterminal json property has an illegal value 
Issue History
2016-08-12 12:46OrekariaTypedefect => backport
2016-08-12 12:46OrekariaTarget VersionRR16Q4 => RR16Q3.2
2016-08-15 19:00mtaalRelationship addedrelated to 0033555
2016-08-15 19:01hgbotCheckin
2016-08-15 19:01hgbotNote Added: 0089099
2016-08-15 19:01hgbotStatusscheduled => resolved
2016-08-15 19:01hgbotResolutionopen => fixed
2016-08-15 19:01hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/77435e4a7b40ba41925cf9d53712db38b242675c [^] => http://code.openbravo.com/retail/backports/3.0RR16Q3.1/org.openbravo.retail.posterminal/rev/93c00036438813a470c2399a012067f3efdeffa8 [^]
2016-08-29 13:09mtaalTarget VersionRR16Q3.2 => RR16Q3.1
2016-08-30 11:22guilleaerReview Assigned Tomigueldejuana => guilleaer
2016-08-30 11:22guilleaerStatusresolved => closed
2016-08-30 11:22guilleaerFixed in Version => RR16Q3.1

Notes
(0089099)
hgbot   
2016-08-15 19:01   
Repository: retail/backports/3.0RR16Q3.1/org.openbravo.retail.posterminal
Changeset: 93c00036438813a470c2399a012067f3efdeffa8
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Aug 15 19:01:22 2016 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR16Q3.1/org.openbravo.retail.posterminal/rev/93c00036438813a470c2399a012067f3efdeffa8 [^]

Fixes issue 33701: NPE in POSImportEntryProcessor when the posterminal json property has an illegal value
If no posterminal id can be found then still create the import entry but with status error.
Also use static finals were appropriate.
The changeset for issue 33555 has been included in the commit as it seemed better to keep than to rework the
code to a new version.

---
M src/org/openbravo/retail/posterminal/importprocess/POSImportEntryProcessor.java
---