Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035561Openbravo ERPA. Platformpublic2017-03-17 14:092017-03-20 23:12
alostale 
alostale 
immediateminorhave not tried
closedfixed 
5
 
3.0PR17Q2 
caristu
Core
Pre packaging ( pi )
2017-01-30
pi
http://code.openbravo.com/erp/devel/pi/rev/72cf9d166978c4cf23b1fd261fb81728e65172bc [^]
No
0035561: logged NPE in audit trail creating tickets from POS
Having activated audit trail and using tomcat jdbc pool, a NPE is logged whenever a ticket is created from POS.

Though this is logged, it has no effect as the error is properly handled.

1. In a retail instance activate audit trail for c_order
2. Create a ticket in WebPOS
  -> check logs:
ERROR org.openbravo.database.SessionInfo - Error setting audit info
java.lang.NullPointerException
    at java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:815)
    at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:64)
    at com.sun.proxy.$Proxy24.equals(Unknown Source)
    at org.openbravo.database.SessionInfo.saveContextInfoIntoDB(SessionInfo.java:221)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:258)
    at org.openbravo.dal.service.OBDal.getConnection(OBDal.java:185)
    at org.openbravo.dal.service.OBDal.getConnection(OBDal.java:169)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:253)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:153)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:85)
    at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:42)
    at org.openbravo.retail.posterminal.importprocess.OrderImportEntryProcessor$OrderLoaderRunnable.processEntry(OrderImportEntryProcessor.java:59)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.doRunCycle(ImportEntryProcessor.java:370)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.run(ImportEntryProcessor.java:292)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
It occurs for DB connections obtained from ImportEntryProcess, in this line of code:

if (conn.equals(sessionConnection.get())) {

The root cause of this problem is unknown and difficult to debug as it occurs in a proxy which code is not accessible com.sun.proxy.$Proxy24.equals(Unknown Source) which for some reason fails for ImpoertEntry connections.

This comparison can be safely replaced with a reference comparison, as the connection would always be the same instance to satisfy the if statemented.

No tags attached.
caused by design defect 0035007 closed alostale audit trail causes excessive overhead 
Issue History
2017-03-17 14:09alostaleNew Issue
2017-03-17 14:09alostaleAssigned To => alostale
2017-03-17 14:09alostaleModules => Core
2017-03-17 14:09alostaleRegression level => Pre packaging ( pi )
2017-03-17 14:09alostaleRegression date => 2017-01-30
2017-03-17 14:09alostaleRegression introduced in release => pi
2017-03-17 14:09alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/72cf9d166978c4cf23b1fd261fb81728e65172bc [^]
2017-03-17 14:09alostaleTriggers an Emergency Pack => No
2017-03-17 14:10alostaleRelationship addedcaused by 0035007
2017-03-17 14:10alostaleReview Assigned To => caristu
2017-03-17 14:22hgbotCheckin
2017-03-17 14:22hgbotNote Added: 0095378
2017-03-17 14:22hgbotStatusnew => resolved
2017-03-17 14:22hgbotResolutionopen => fixed
2017-03-17 14:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0f00bec42b482af94926e6f16f6bc4997149fb3e [^]
2017-03-17 15:00caristuNote Added: 0095381
2017-03-17 15:00caristuStatusresolved => closed
2017-03-17 15:00caristuFixed in Version => 3.0PR17Q2
2017-03-20 23:12hudsonbotCheckin
2017-03-20 23:12hudsonbotNote Added: 0095448

Notes
(0095378)
hgbot   
2017-03-17 14:22   
Repository: erp/devel/pi
Changeset: 0f00bec42b482af94926e6f16f6bc4997149fb3e
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Mar 17 14:18:39 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0f00bec42b482af94926e6f16f6bc4997149fb3e [^]

fixed bug 35561: logged NPE in audit trail creating tickets from POS

  When connection was obtained by ImportEntry a NPE was logged while setting
  audit trail. In this situation the proxied connection fails when invoking
  its equals method.

  In this case, equals was not necessary as what we really want to check is
  we're working with the same connection instance.

---
M src-core/src/org/openbravo/database/SessionInfo.java
---
(0095381)
caristu   
2017-03-17 15:00   
Code reviewed + tested OK:

- The ticket is created correctly
- Audit Info is created correctly
- Exception is not thrown
(0095448)
hudsonbot   
2017-03-20 23:12   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/ba27e12a1e16 [^]
Maturity status: Test