Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039636Retail ModulesStoreServerpublic2018-11-15 15:142018-11-15 23:22
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
 
mtaal
No
0039636: Exception in SetCurrentMobileServerListener due to null OBContext
As a result of this change [1], the following error appears in the console when Tomcat is started:

67916 [localhost-startStop-1] ERROR org.openbravo.mobile.core.listener.SetCurrentMobileServerListener - Error while set current mobile server listener
org.openbravo.base.exception.OBException: java.lang.NullPointerException
    at org.openbravo.dal.core.OBInterceptor.doEvent(OBInterceptor.java:344)
    at org.openbravo.dal.core.OBInterceptor.onFlushDirty(OBInterceptor.java:186)
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:362)
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:332)
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:283)
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:154)
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:235)
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:94)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1454)
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1440)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:257)
    at org.openbravo.dal.core.SessionHandler.flushRemainingChanges(SessionHandler.java:692)
    at org.openbravo.dal.core.SessionHandler.commitAndClose(SessionHandler.java:604)
    at org.openbravo.dal.service.OBDal.commitAndClose(OBDal.java:220)
    at org.openbravo.mobile.core.listener.SetCurrentMobileServerListener.contextInitialized(SetCurrentMobileServerListener.java:60)

The only consequence is that the isCuarrent column of the obmobc_server_definition table is not set. That property is only used by the synchronization of ad_process_run entries.

[1] https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d7961f24089f#l2.1 [^]
In a multiserver environment, start Tomcat. The error will appear in the log
No tags attached.
caused by feature request 0032427RR16Q3 closed Sandrahuguet Implement Store Server Process Requests APIs 
Issue History
2018-11-15 15:14AugustoMauchNew Issue
2018-11-15 15:14AugustoMauchAssigned To => AugustoMauch
2018-11-15 15:14AugustoMauchTriggers an Emergency Pack => No
2018-11-15 15:14AugustoMauchRelationship addedcaused by 0032427
2018-11-15 15:30AugustoMauchReview Assigned To => mtaal
2018-11-15 15:31hgbotCheckin
2018-11-15 15:31hgbotNote Added: 0107933
2018-11-15 15:31hgbotStatusnew => resolved
2018-11-15 15:31hgbotResolutionopen => fixed
2018-11-15 15:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3f35fd66053b00b033688049c69e093948cdb05f [^]
2018-11-15 23:22mtaalNote Added: 0107939
2018-11-15 23:22mtaalStatusresolved => closed

Notes
(0107933)
hgbot   
2018-11-15 15:31   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3f35fd66053b00b033688049c69e093948cdb05f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Nov 15 15:22:34 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3f35fd66053b00b033688049c69e093948cdb05f [^]

Fixes issue 39636: SetCurrentMobileServerListener does not throw exception

The problem was that OBDal.getInstance().commitAndClose(); was being executed without a valid
OBContext. In a listener the OBContext has not been set yet, so that line must be executed
within a setAdminMode block.

It used to work "by luck", just because a previous listener was leaving a setAdminMode lock open.

---
M src/org/openbravo/mobile/core/listener/SetCurrentMobileServerListener.java
---
(0107939)
mtaal   
2018-11-15 23:22   
reviewed