Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034027Openbravo ERPA. Platformpublic2016-09-20 09:282016-09-27 18:50
alostale 
alostale 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR16Q4 
caristu
Core
No
0034027: NPE in build process if db.queryTimeout.* is set
When setting in Openbravo.properties any profile for db.queryTimeout, a NPE is thrown in build process.
* Edit Openbravo.properties and add db.queryTimeout.grid=1
* Run ant smartbuild -Dlocal=no
  -> Check logs:
apply.module:
     [java] 1 [main] ERROR org.openbravo.base.provider.OBProviderException - Exception when instantiating class org.openbravo.service.db.QueryTimeOutUtil for registration org.openbravo.service.db.QueryTimeOutUtil
     [java] java.lang.NullPointerException
     [java] at org.openbravo.service.db.QueryTimeOutUtil.testQueryTimeOut(QueryTimeOutUtil.java:119)
     [java] at org.openbravo.service.db.QueryTimeOutUtil.<init>(QueryTimeOutUtil.java:73)
     [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
     [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     [java] at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
     [java] at java.lang.Class.newInstance(Class.java:383)
     [java] at org.openbravo.base.provider.OBProvider$Registration.getInstance(OBProvider.java:244)
     [java] at org.openbravo.base.provider.OBProvider.get(OBProvider.java:170)
     [java] at org.openbravo.service.db.QueryTimeOutUtil.getInstance(QueryTimeOutUtil.java:66)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleData.selectClientReferenceModules(ApplyModuleData.java:197)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleData.selectClientReferenceModules(ApplyModuleData.java:178)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleTask.execute(ApplyModuleTask.java:73)
     [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] at java.lang.reflect.Method.invoke(Method.java:606)
     [java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] at org.apache.tools.ant.Target.execute(Target.java:435)
     [java] at org.apache.tools.ant.Target.performTasks(Target.java:456)
     [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
     [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
     [java] at org.openbravo.base.AntExecutor.runTask(AntExecutor.java:133)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleTask.main(ApplyModuleTask.java:56)
     [java] 31 [main] ERROR org.openbravo.erpCommon.modules.ApplyModuleData - Exception in query: SELECT M.JAVAPACKAGE, M.NAME, M.AD_MODULE_ID, D.NAME as DS_NAME FROM AD_MODULE M, AD_DATASET D WHERE (M.STATUS = 'I' OR M.STATUS = 'P') AND M.HASREFERENCEDATA = 'Y' AND D.AD_MODULE_ID = M.AD_MODULE_ID AND D.ACCESSLEVEL = '4'Exception:org.openbravo.base.provider.OBProviderException: Exception when instantiating class org.openbravo.service.db.QueryTimeOutUtil for registration org.openbravo.service.db.QueryTimeOutUtil
No tags attached.
Issue History
2016-09-20 09:28alostaleNew Issue
2016-09-20 09:28alostaleAssigned To => platform
2016-09-20 09:28alostaleModules => Core
2016-09-20 09:28alostaleTriggers an Emergency Pack => No
2016-09-20 09:33alostaleReview Assigned To => caristu
2016-09-20 09:39hgbotCheckin
2016-09-20 09:39hgbotNote Added: 0090101
2016-09-20 09:39hgbotStatusnew => resolved
2016-09-20 09:39hgbotResolutionopen => fixed
2016-09-20 09:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1c1111f455556d267130911900a37bdc6c4a364b [^]
2016-09-20 22:23hudsonbotCheckin
2016-09-20 22:23hudsonbotNote Added: 0090123
2016-09-27 18:49caristuNote Added: 0090311
2016-09-27 18:49caristuStatusresolved => closed
2016-09-27 18:49caristuFixed in Version => 3.0PR16Q4
2016-09-27 18:50caristuAssigned Toplatform => alostale

Notes
(0090101)
hgbot   
2016-09-20 09:39   
Repository: erp/devel/pi
Changeset: 1c1111f455556d267130911900a37bdc6c4a364b
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Sep 20 09:37:30 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1c1111f455556d267130911900a37bdc6c4a364b [^]

fixed bug 34027: NPE in build process if db.queryTimeout.* is set

  This NPE was thrown because in build process a connection was tried to be
  obtained from DAL which is not available this throws an expection that is
  not logged but left a statement with null value that later was tried to be
  closed, throwing the NPE.

  Fixed by guarding null value of the statement before closing it.

---
M src/org/openbravo/service/db/QueryTimeOutUtil.java
---
(0090123)
hudsonbot   
2016-09-20 22:23   
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/c5edc648de35 [^]
Maturity status: Test
(0090311)
caristu   
2016-09-27 18:49   
Code review + testing OK: build process ends successfully having db.queryTimeout set in Openbravo.properties.