Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0031836
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POScriticalalways2016-01-08 09:492016-01-19 17:19
ReportergorkaionView Statuspublic 
Assigned Tomtaal 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionc911b65dace6
ProjectionnoneETAnoneTarget VersionRR16Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionmainSCM revision 
Review Assigned Tomigueldejuana
Regression levelQA functional test
Regression date2015-11-27
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bc165573bb04 [^]
Triggers an Emergency PackNo
Summary

0031836: Null Pointer Exception on Save again button of Errors While Importing POS Data

DescriptionIf an Order fails to integrate and appear in the Errors While Importing POS Data. When clicking on the Save again button a Null Pointer Exception message appears.
Steps To Reproduce1. ensure that the current period is closed (in Open/Close Period Control)
2. create a new receipt in the POS
3. check that the receipt appear in the Errors While Importing POS Data with period closed error.
4. Open the period again
5. Click on Save Again button of "Errors While Importing POS Data" window.
6. See that a Null Pointer Exception message popup appears and the order is not processed.
Proposed SolutionThe real exception is thrown in the SaveDataActionHandler class of org.openbravo.retail.posterminal.

Based in the Data Type of the error record it has to search the java class that manages the json that has to be imported. Since the ExternalOrderLoaded was added there are 2 different classes implementing the "Order" entity. So the following line of code throws a WELD exception as it does not know which class to inject
syncProcess = syncProcesses.select(new DataSynchronizationProcess.Selector(type)).get();

This exception is catched in the last catch Exception block. After this catch the SaveDataActionHandler is returning a null that it is the reason of the NPE message.

2 fixes must be done:

* The execute method should never return null. It should return an empty JSON or preferably a JSON with the error message.
* When the java class that manages the json is loaded it should consider the case when more than one is present and should pick up one. Based on the json or setting up some priorities on the classes.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0031854RR16Q1 closedmtaal Null Pointer Exception on Save again button of Errors While Importing POS Data 

-  Notes
(0083272)
mtaal (manager)
2016-01-13 19:33

Imho it is correct to throw an error if there is more than orderloader which Weld finds. To handle this correctly would mean that we need an additional selection mechanism. I think this requires a separate design activity if there is at all a need to support this.

gr. Martin
(0083273)
hgbot (developer)
2016-01-13 20:11

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: c911b65dace6da39d028fe4898646f3adb2e9882
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Jan 13 19:52:26 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c911b65dace6da39d028fe4898646f3adb2e9882 [^]

Fixes issue 31836: Null Pointer Exception on Save again button of Errors While Importing POS Data
Remove annotation to not confuse Weld, compute entity directly, improve error message when error occurs in save import error

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
M src/org/openbravo/retail/posterminal/SaveDataActionHandler.java
---
(0083412)
migueldejuana (developer)
2016-01-19 17:19

Tested and reviewed in RR16Q2

- Issue History
Date Modified Username Field Change
2016-01-08 09:49 gorkaion New Issue
2016-01-08 09:49 gorkaion Assigned To => Retail
2016-01-08 09:49 gorkaion Resolution time => 1452553200
2016-01-08 09:49 gorkaion Regression level => QA functional test
2016-01-08 09:49 gorkaion Regression date => 2015-11-27
2016-01-08 09:49 gorkaion Regression introduced in release => pi
2016-01-08 09:49 gorkaion Regression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bc165573bb04 [^]
2016-01-08 09:49 gorkaion Triggers an Emergency Pack => No
2016-01-11 11:29 Orekaria Status new => scheduled
2016-01-11 11:29 Orekaria Assigned To Retail => mtaal
2016-01-11 11:29 Orekaria Status scheduled => acknowledged
2016-01-11 11:30 Orekaria Status acknowledged => scheduled
2016-01-13 13:56 mtaal Target Version RR16Q1 => RR16Q2
2016-01-13 19:33 mtaal Note Added: 0083272
2016-01-13 20:11 hgbot Checkin
2016-01-13 20:11 hgbot Note Added: 0083273
2016-01-13 20:11 hgbot Status scheduled => resolved
2016-01-13 20:11 hgbot Resolution open => fixed
2016-01-13 20:11 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c911b65dace6da39d028fe4898646f3adb2e9882 [^]
2016-01-14 13:11 mtaal Review Assigned To => marvintm
2016-01-18 16:48 mtaal Review Assigned To marvintm => migueldejuana
2016-01-19 17:19 migueldejuana Note Added: 0083412
2016-01-19 17:19 migueldejuana Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker