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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033692
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServerminorhave not tried2016-08-11 18:252016-08-30 10:12
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in VersionRR16Q4
StatusclosedFix in branchFixed in SCM revision6ccbd09b41f4
ProjectionnoneETAnoneTarget VersionRR16Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033692: Prevent NPE in case no mobile server definition present but still server key is set

DescriptionWhen there is no mobile server definition present but the server key is set in the Openbravo.properties then tomcat starts with a NPE shown below.

It can be the case that this exception occurs because the query finds nothing. Although it seems to fail in another location, it that there is no context set. A solution can be to set admin mode so that there is an OBContext.

[1]
[12:36:52] Ioritz Cia: but when I start tomcat
[12:36:58] Ioritz Cia: this error appears
[12:37:03] Ioritz Cia: although tomcat starts
[12:37:09] Ioritz Cia: and the environment works
[12:37:23] Ioritz Cia: ERROR org.openbravo.mobile.core.listener.SetCurrentMobileServerListener - Error while set current mobile server listener
java.lang.NullPointerException
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:597)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:588)
    at org.openbravo.dal.service.OBDal.createCriteria(OBDal.java:435)
    at org.openbravo.mobile.core.listener.SetCurrentMobileServerListener.getCurrentServer(SetCurrentMobileServerListener.java:69)
    at org.openbravo.mobile.core.listener.SetCurrentMobileServerListener.contextInitialized(SetCurrentMobileServerListener.java:49)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
    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)
Steps To ReproduceRun standard retail
Set mobile.server.key to any value in Openbravo.properties
restart
Proposed SolutionSee description
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
causes defect 0034756 closedSandrahuguet Transaction left open leads to database locks when updating entries from the Mobile Server window 

-  Notes
(0089060)
hgbot (developer)
2016-08-11 23:39

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 7202f533b1ea8023df558f4a8f626f1555e57aa5
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Aug 11 23:38:33 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7202f533b1ea8023df558f4a8f626f1555e57aa5 [^]

Fixes issue 33692: Prevent NPE in case no mobile server definition present but still server key is set
Wrap the call to get the current mobile server in an admin context to prevent NPE.

---
M src/org/openbravo/mobile/core/listener/SetCurrentMobileServerListener.java
---
(0089078)
Sandrahuguet (developer)
2016-08-12 10:01

reviewed and tested
(0089213)
mtaal (manager)
2016-08-18 13:56

I new NPE now occurs after this initial fix:

java.lang.NullPointerException
        at org.openbravo.dal.core.OBInterceptor.onUpdate(OBInterceptor.java:406)
        at org.openbravo.dal.core.OBInterceptor.doEvent(OBInterceptor.java:332)
        at org.openbravo.dal.core.OBInterceptor.onFlushDirty(OBInterceptor.java:181)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:372)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:349)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:287)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:155)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
        at org.hibernate.event.def.DefaultDirtyCheckEventListener.onDirtyCheck(DefaultDirtyCheckEventListener.java:54)
        at org.hibernate.impl.SessionImpl.isDirty(SessionImpl.java:1202)
        at org.openbravo.dal.core.SessionHandler.flushRemainingChanges(SessionHandler.java:343)
        at org.openbravo.dal.core.SessionHandler.commitAndClose(SessionHandler.java:287)
        at org.openbravo.dal.service.OBDal.commitAndClose(OBDal.java:174)
        at org.openbravo.mobile.core.listener.SetCurrentMobileServerListener.contextInitialized(SetCurrentMobileServerListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
(0089234)
hgbot (developer)
2016-08-19 10:55

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6ccbd09b41f4f63715b94809d5e0da61afbad69d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Aug 19 10:55:11 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6ccbd09b41f4f63715b94809d5e0da61afbad69d [^]

Fixes issue 33692: Prevent NPE in case no mobile server definition present but still server key is set
Do the commit within the admin mode this prevents the second NPE being reported. Also rollback in case
of an error.

---
M src/org/openbravo/mobile/core/listener/SetCurrentMobileServerListener.java
---
(0089533)
Sandrahuguet (developer)
2016-08-30 10:12

reviewed

- Issue History
Date Modified Username Field Change
2016-08-11 18:25 mtaal New Issue
2016-08-11 18:25 mtaal Assigned To => mtaal
2016-08-11 18:25 mtaal Triggers an Emergency Pack => No
2016-08-11 23:38 mtaal Review Assigned To => Sandrahuguet
2016-08-11 23:39 hgbot Checkin
2016-08-11 23:39 hgbot Note Added: 0089060
2016-08-11 23:39 hgbot Status new => resolved
2016-08-11 23:39 hgbot Resolution open => fixed
2016-08-11 23:39 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7202f533b1ea8023df558f4a8f626f1555e57aa5 [^]
2016-08-12 10:01 Sandrahuguet Note Added: 0089078
2016-08-12 10:01 Sandrahuguet Status resolved => closed
2016-08-12 10:01 Sandrahuguet Fixed in Version => RR16Q4
2016-08-18 13:56 mtaal Note Added: 0089213
2016-08-18 13:56 mtaal Status closed => new
2016-08-18 13:56 mtaal Resolution fixed => open
2016-08-18 13:56 mtaal Fixed in Version RR16Q4 =>
2016-08-19 10:55 hgbot Checkin
2016-08-19 10:55 hgbot Note Added: 0089234
2016-08-19 10:55 hgbot Status new => resolved
2016-08-19 10:55 hgbot Resolution open => fixed
2016-08-19 10:55 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7202f533b1ea8023df558f4a8f626f1555e57aa5 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6ccbd09b41f4f63715b94809d5e0da61afbad69d [^]
2016-08-30 10:12 Sandrahuguet Note Added: 0089533
2016-08-30 10:12 Sandrahuguet Status resolved => closed
2016-08-30 10:12 Sandrahuguet Fixed in Version => RR16Q4
2016-12-20 09:29 dmitry_mezentsev Relationship added causes 0034756


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker