Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036115Openbravo ERPA. Platformpublic2017-05-26 10:482017-06-23 13:53
eduardo_Argal 
caristu 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
inigosanchez
Core
No
0036115: A request is being sent when adding a widget even if parameters have not yet been set
A request to the datasource is being sent when adding a widget even if parameters have not yet been set. This ends up in an error in log when it should not.
Install this widgets module:
https://bitbucket.org/gpscode/but_com.openbravo.retail.reports-customwidgets [^]
Add Total Store Sales widget to the workspace
Parameter window should be displayed for the widget as there are a couple of date mandatory parameters which needs to be set before running the widget.
Mind that an error appears in the log:
148304779 [http-bio-8080-exec-9] ERROR org.openbravo.service.datasource.DataSourceServlet - Not all named parameters have been set: [dateTo, dateFrom] [select o.name as organizationName,
so.orderDate as orderDate,
sum(so.grandTotalAmount) as grandTotal
from Order so
join so.organization o
join so.documentType dt
where so.documentStatus in ('CO', 'CL')
and (dt.sOSubType is null or dt.sOSubType <> 'OB')
and so.grandTotalAmount <> 0
and so.orderDate >= TO_DATE('03-20-2017', 'MM-DD-YYYY')
and exists (select 1 from FIN_Payment_ScheduleDetail fpsd, FIN_Payment_Schedule fps where fps = fpsd.orderPaymentSchedule and fps.order = so and fpsd.paymentDetails is not null)
and o.id in (:organizationList)
and so.orderDate >= :dateFrom
and so.orderDate <= :dateTo
and 1=1
group by o.name, so.orderDate
order by so.orderDate]
org.hibernate.QueryException: Not all named parameters have been set: [dateTo, dateFrom] [select o.name as organizationName,
so.orderDate as orderDate,
sum(so.grandTotalAmount) as grandTotal
from Order so
join so.organization o
join so.documentType dt
where so.documentStatus in ('CO', 'CL')
and (dt.sOSubType is null or dt.sOSubType <> 'OB')
and so.grandTotalAmount <> 0
and so.orderDate >= TO_DATE('03-20-2017', 'MM-DD-YYYY')
and exists (select 1 from FIN_Payment_ScheduleDetail fpsd, FIN_Payment_Schedule fps where fps = fpsd.orderPaymentSchedule and fps.order = so and fpsd.paymentDetails is not null)
and o.id in (:organizationList)
and so.orderDate >= :dateFrom
and so.orderDate <= :dateTo
and 1=1
group by o.name, so.orderDate
order by so.orderDate]
    at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:338)
    at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:322)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:98)
    at org.openbravo.client.querylist.QueryListDataSource.getData(QueryListDataSource.java:281)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(ReadOnlyDataSourceService.java:149)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDataSourceService.java:73)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:285)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:841)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:228)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:454)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:58)
    at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:153)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    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:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    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:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Remove the request if parameters have not yet been set in first run
Performance
Issue History
2017-05-26 10:48eduardo_ArgalNew Issue
2017-05-26 10:48eduardo_ArgalAssigned To => platform
2017-05-26 10:48eduardo_ArgalModules => Core
2017-05-26 10:48eduardo_ArgalTriggers an Emergency Pack => No
2017-06-02 11:17alostaleTag Attached: Performance
2017-06-02 11:17alostaleStatusnew => acknowledged
2017-06-16 12:39eduardo_ArgalResolution time => 1498773600
2017-06-22 13:33caristuAssigned Toplatform => caristu
2017-06-22 14:03hgbotCheckin
2017-06-22 14:03hgbotNote Added: 0097587
2017-06-22 14:03hgbotStatusacknowledged => resolved
2017-06-22 14:03hgbotResolutionopen => fixed
2017-06-22 14:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/12dac8fcf979eb012b508946f878db192718b6cb [^]
2017-06-22 14:04caristuReview Assigned To => inigosanchez
2017-06-23 13:46inigosanchezNote Added: 0097613
2017-06-23 13:46inigosanchezStatusresolved => closed
2017-06-23 13:46inigosanchezFixed in Version => 3.0PR17Q3
2017-06-23 13:53hudsonbotCheckin
2017-06-23 13:53hudsonbotNote Added: 0097615

Notes
(0097587)
hgbot   
2017-06-22 14:03   
Repository: erp/devel/pi
Changeset: 12dac8fcf979eb012b508946f878db192718b6cb
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jun 22 13:54:18 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/12dac8fcf979eb012b508946f878db192718b6cb [^]

fixes bug 36115: Error when adding widgets if mandatory params aren't set

  After adding a widget in the workspace, a request was fired even if the mandatory parameters were not set. This could cause the failure of the query launched by the datasource because the parameters expected by the query were not resolved.

  Note that this problem does not affect to the 'showAll' and 'RowsNumber' standard parameters because the datasource handles properly the case of not receiving these parameters in the request.

  To fix this error, now the requests to retrieve/refesh the widget data are prevented if not all the mandatory parameters are set.

---
M modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js
---
(0097613)
inigosanchez   
2017-06-23 13:46   
Tested and verified in pi@d816955a96eb
(0097615)
hudsonbot   
2017-06-23 13:53   
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/678e11052373 [^]
Maturity status: Test