Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028047Openbravo ERPA. Platformpublic2014-11-01 14:282014-12-30 23:27
mtaal 
NaroaIriarte 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q13.0PR15Q1 
alostale
Core
No
0028047: Log shows error which is actively (and correctly ignored) in AdvancedQueryBuilder, prevent this exception from showing
- a selector with a where clause with a parameter which is stored in the context, for example this where clause:
e.active = true and exists (select 1 from FinancialMgmtAcctSchemaElement c where c.accountingSchema.id=@EM_Obfdr_Acctschema_ID@ and c.accountingElement.id = e.accountingElement.id)
- the parameter name ends with _ID therefore the advancedquerybuilder tries to resolve it against a entity which does not work
- the exception is actively ignored and the next if will get the value correctly from the context. This is correct.

The problem is that the log shows an error while the value is present in the context correctly.

250403 [http-8080-6] ERROR org.openbravo.base.util.CheckException - Property with EM_Obfdr_Acctschema_ID does not exist for entity OBANALY_Cube_Rep_Dim
org.openbravo.base.util.CheckException: Property with EM_Obfdr_Acctschema_ID does not exist for entity OBANALY_Cube_Rep_Dim
    at org.openbravo.base.util.Check.isNotNull(Check.java:72)
    at org.openbravo.base.model.Entity.getPropertyByColumnName(Entity.java:572)
    at org.openbravo.service.json.AdvancedQueryBuilder.substituteContextParameters(AdvancedQueryBuilder.java:1200)
    at org.openbravo.service.json.AdvancedQueryBuilder.substituteParameters(AdvancedQueryBuilder.java:362)
    at org.openbravo.service.json.AdvancedQueryBuilder.getWhereClause(AdvancedQueryBuilder.java:209)
    at org.openbravo.service.json.AdvancedQueryBuilder.getJoinClause(AdvancedQueryBuilder.java:1302)
    at org.openbravo.service.json.DataEntityQueryService.buildOBQuery(DataEntityQueryService.java:125)
    at org.openbravo.service.json.DataEntityQueryService.list(DataEntityQueryService.java:108)
    at org.openbravo.service.json.DefaultJsonDataService.fetch(DefaultJsonDataService.java:200)
    at org.openbravo.service.datasource.DefaultDataSourceService.fetch(DefaultDataSourceService.java:72)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:261)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:744)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:449)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:92)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63)
    at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:140)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.codehaus.enunciate.webapp.HTTPRequestContextFilter.doFilter(HTTPRequestContextFilter.java:36)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.client.analytics.OBSpringSecurityContextRequestFilter$1.doAction(OBSpringSecurityContextRequestFilter.java:71)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.client.analytics.OBSpringSecurityContextRequestFilter.doFilter(OBSpringSecurityContextRequestFilter.java:79)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.activiti.OBActivitiRequestFilter$1.doAction(OBActivitiRequestFilter.java:68)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.activiti.OBActivitiRequestFilter.doFilter(OBActivitiRequestFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:745)
1) Install analytics module
2) create a cube definition
3) create a child cube report (any value is fine)
4) create a child cube report dimension (any value is fine), this will already show the same error in the log (the functionality works fine)
5) create a cube report dimension element

See the attached screenshot
Check before throwing an exception, so do not show the exception in the log.
No tags attached.
related to defect 0026721 closed mtaal Modules Cannot add an account in the Cube report Dimension Element tab 
related to defect 0026871 closed shankarb Openbravo ERP Error when clicking table tree category drop down in Tabs 
related to defect 0027048 closed Osmany Retail Modules [UX] "Brand" button behavior in SEARCH component is not consistent 
png Selection_066.png (287,104) 2014-11-01 14:28
https://issues.openbravo.com/file_download.php?file_id=7456&type=bug
png Selection_067.png (399,150) 2014-11-01 14:34
https://issues.openbravo.com/file_download.php?file_id=7457&type=bug
Issue History
2014-11-01 14:28mtaalNew Issue
2014-11-01 14:28mtaalAssigned To => AugustoMauch
2014-11-01 14:28mtaalFile Added: Selection_066.png
2014-11-01 14:28mtaalModules => Core
2014-11-01 14:28mtaalTriggers an Emergency Pack => No
2014-11-01 14:30mtaalNote Added: 0071319
2014-11-01 14:32mtaalRelationship addedcauses 0026721
2014-11-01 14:34mtaalFile Added: Selection_067.png
2014-11-03 10:12ngarciaIssue Monitored: ngarcia
2014-11-28 09:17alostaleAssigned ToAugustoMauch => NaroaIriarte
2014-12-10 13:49alostaleRelationship addedrelated to 0026871
2014-12-10 13:50alostaleRelationship replacedrelated to 0026721
2014-12-10 15:16hgbotCheckin
2014-12-10 15:16hgbotNote Added: 0072403
2014-12-10 15:16hgbotStatusnew => resolved
2014-12-10 15:16hgbotResolutionopen => fixed
2014-12-10 15:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cfa2b4b9d30f6b25fd348ce6c130d6ad7996f225 [^]
2014-12-10 15:17alostaleReview Assigned To => alostale
2014-12-10 15:17alostaleNote Added: 0072404
2014-12-10 15:17alostaleStatusresolved => closed
2014-12-10 15:17alostaleFixed in Version => 3.0PR15Q1
2014-12-30 23:27hudsonbotCheckin
2014-12-30 23:27hudsonbotNote Added: 0073205
2015-03-13 15:46OrekariaRelationship addedrelated to 0027048

Notes
(0071319)
mtaal   
2014-11-01 14:30   
See here for docs on how to setup a cube which results in the exception in the log:
http://wiki.openbravo.com/wiki/Modules:Dimensional_Profit_And_Loss#Configure_Profit_And_Loss_Accounts [^]

Check the related issue also.
(0072403)
hgbot   
2014-12-10 15:16   
Repository: erp/devel/pi
Changeset: cfa2b4b9d30f6b25fd348ce6c130d6ad7996f225
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Wed Dec 10 14:30:29 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cfa2b4b9d30f6b25fd348ce6c130d6ad7996f225 [^]

Fixed issue 28047:An exception is shown in console.

There was an exception that was ignored (this is a correct behaviour), but it was shown in the log.
This exception appeared when, in cube definition window a cube Report Dimension was created. Then the log showed
the exception, but the Cube Report Dimension was correctly created. So, the exception needed not to be shown.

For fixing this the "AdvancedQueryBuilder" java class has been modified.
The exception was thrown before because the method <getPropertyByColumnName(String ColumName)> was called
and this method always checks the "isNotNull". When the variable was null, the message and the exception was catched
and shown.
For avoiding this, the method <getPropertyByColumnName(param, checkIsNoNull)> has been called instead the other one.
This method, has an input parameter called "checkIsNotNull", putting this to false, avoids the evaluation of the function
"isNotNull", so, if the variable is null it doesn't matter and the message and the exception shown before does not appear now.
The problem is that we get a "nullPointerException" if we do nothing else more.
For avoiding this, a condition has been added to the code in the "AdvancedQueryBuilder" java class. If the prop variable is
null, the paramValue variable gets the empty string value. And as the value for paramValue variable cannot be reached from
the request, it is get from the context.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0072404)
alostale   
2014-12-10 15:17   
code reviewed

tested based on explained steps to reproduce + related issue 0026871
(0073205)
hudsonbot   
2014-12-30 23:27   
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/6525fe229e06 [^]
Maturity status: Test