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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039732
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajorhave not tried2018-12-03 11:132018-12-11 13:53
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiond145e0803b92
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0039732: NPE When routing BP

DescriptionSee stacktrace [1]

[1]
Caused by: org.openbravo.base.exception.OBException: Error while routing a c_bpartner null
    at org.openbravo.retail.storeserver.synchronization.router.BusinessPartnerRouter.doRouteToNodes(BusinessPartnerRouter.java:62) ~[BusinessPartnerRouter.class:?]
    at org.openbravo.replication.symmetricds.extensions.AbstractClientFilteredRouter.routeToNodes(AbstractClientFilteredRouter.java:60) ~[AbstractClientFilteredRouter.class:?]
    at org.openbravo.retail.storeserver.synchronization.router.BusinessPartnerRouter$Proxy$_$$_WeldClientProxy.routeToNodes(BusinessPartnerRouter$Proxy$_$$_WeldClientProxy.java) ~[BusinessPartnerRouter.class:?]
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(RouterService.java:940) ~[symmetric-core-3.8.24.jar:?]
    ... 15 more
Caused by: java.lang.NullPointerException
    at org.openbravo.retail.storeserver.synchronization.utils.BusinessPartnerSegmentationUtils.getNodesForBusinessPartner(BusinessPartnerSegmentationUtils.java:299) ~[BusinessPartnerSegmentationUtils.class:?]
    at org.openbravo.retail.storeserver.synchronization.router.BusinessPartnerRouter.doRouteToNodes(BusinessPartnerRouter.java:58) ~[BusinessPartnerRouter.class:?]
    at org.openbravo.replication.symmetricds.extensions.AbstractClientFilteredRouter.routeToNodes(AbstractClientFilteredRouter.java:60) ~[AbstractClientFilteredRouter.class:?]
    at org.openbravo.retail.storeserver.synchronization.router.BusinessPartnerRouter$Proxy$_$$_WeldClientProxy.routeToNodes(BusinessPartnerRouter$Proxy$_$$_WeldClientProxy.java) ~[BusinessPartnerRouter.class:?]
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(RouterService.java:940) ~[symmetric-core-3.8.24.jar:?]
Steps To Reproducehandle the case that the BP was deleted
set null value in BP record standard customer column
Proposed Solutionhandle case that BP was deleted
use Boolean instead of boolean and assume null value = false
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0108232)
hgbot (developer)
2018-12-03 18:31

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 22b7915550a411ff8a41953cb4cdf6dcd77931d1
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Dec 03 18:31:06 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/22b7915550a411ff8a41953cb4cdf6dcd77931d1 [^]

Fixes issue 39732: NPE When routing BP
Handle null value in safe way, handle bp deletion also

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/BusinessPartnerEventHandlerForStandardCustomerFlag.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericEventHandlerForStandardCustomerFlag.java
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerLocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/LocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0108364)
AugustoMauch (developer)
2018-12-10 16:11

There are two topics that should be addressed:
- The isObstsynStoreCustomer is a not-null property, so no need to check it safely. It is the businessPartner itself that can be null.
- At this point [1], we cannot assume that the change was a business partner deletion. It could also be, for instance, an update on a user that referenced the missing business partner, and the referenced business partner was deleted before the user change was routed.

In that case, it seems the proper logic would be:
- If business partner is null->
      - It change is deletion -> send to all
      - otherwise (insert or update) -> send to none


[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/22b7915550a411ff8a41953cb4cdf6dcd77931d1#l5.1 [^]
(0108376)
hgbot (developer)
2018-12-10 22:37

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 9575f92a0a9eef71d6124253d3b7d1898425ab5b
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Dec 10 22:24:47 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/9575f92a0a9eef71d6124253d3b7d1898425ab5b [^]

Related to issue 39732: NPE When routing BP
Backed out changeset 22b7915550a4

---
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/BusinessPartnerEventHandlerForStandardCustomerFlag.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/GenericEventHandlerForStandardCustomerFlag.java
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerLocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/LocationRouter.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0108378)
hgbot (developer)
2018-12-11 07:57

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: d145e0803b9252da89c2fb6984ff941988c3d142
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Dec 11 07:57:42 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d145e0803b9252da89c2fb6984ff941988c3d142 [^]

Fixes issue 39732: NPE When routing BP
Handle the delete in the user/bp routers, log error in case bp is found to be deleted later

---
M src/org/openbravo/retail/storeserver/synchronization/router/BusinessPartnerRouter.java
M src/org/openbravo/retail/storeserver/synchronization/router/UserRouter.java
M src/org/openbravo/retail/storeserver/synchronization/utils/BusinessPartnerSegmentationUtils.java
---
(0108388)
AugustoMauch (developer)
2018-12-11 13:53

Code reviewed and verified

- Issue History
Date Modified Username Field Change
2018-12-03 11:13 mtaal New Issue
2018-12-03 11:13 mtaal Assigned To => mtaal
2018-12-03 11:13 mtaal Triggers an Emergency Pack => No
2018-12-03 18:30 mtaal Steps to Reproduce Updated View Revisions
2018-12-03 18:30 mtaal Proposed Solution updated
2018-12-03 18:31 hgbot Checkin
2018-12-03 18:31 hgbot Note Added: 0108232
2018-12-03 18:31 hgbot Status new => resolved
2018-12-03 18:31 hgbot Resolution open => fixed
2018-12-03 18:31 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/22b7915550a411ff8a41953cb4cdf6dcd77931d1 [^]
2018-12-09 22:06 mtaal Review Assigned To => AugustoMauch
2018-12-10 16:11 AugustoMauch Note Added: 0108364
2018-12-10 16:11 AugustoMauch Status resolved => new
2018-12-10 16:11 AugustoMauch Resolution fixed => open
2018-12-10 22:37 hgbot Checkin
2018-12-10 22:37 hgbot Note Added: 0108376
2018-12-11 07:57 hgbot Checkin
2018-12-11 07:57 hgbot Note Added: 0108378
2018-12-11 07:57 hgbot Status new => resolved
2018-12-11 07:57 hgbot Resolution open => fixed
2018-12-11 07:57 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/22b7915550a411ff8a41953cb4cdf6dcd77931d1 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d145e0803b9252da89c2fb6984ff941988c3d142 [^]
2018-12-11 13:53 AugustoMauch Note Added: 0108388
2018-12-11 13:53 AugustoMauch Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker