Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007480Openbravo ERP03. Procurement managementpublic2009-01-23 16:492009-02-26 11:28
alostale 
rafaroda 
highmajoralways
closedfixed 
5
pi 
2.40MP3 
Core
No
0007480: SQL error badly informed when printing Jasper Report
Purchase Order Report seems not to work since when trying to execute it the following error is raised in UI:
      
Error executing SQL statement for : ReportPurchaseOrder

The log error is:
16:33:41 [http-8880-Processor21] ERROR org.openbravo.erpCommon.utility.PrintJR - Error captured: javax.servlet.ServletException: Error executing SQL statement for : ReportPurchaseOrder

-Go to Procurement Management > Analysis tools > Purchase Order Report
-Execute it
The problem here is not in the report, which is working correctly, but in the way SQL errors of Jasper Reports are catch when printing them.

What it is happening in this report is that a message is informing that there is no conversion rate for some transaction. Method renderJR is displaying a plain 'Error executing SQL statement for' + the name of the method without informing about the real cause of the problem.

If the error were a SQL error, the message should look like:
ERROR: column c_bpartner.tercero does not exist (see attached AfterFix.png)
but now it is displaying the plain error meesage:
Error executing SQL statement for : ReportPurchaseOrder (see attached BeforeFix.png)

Proposed solution is to change, inside renderJR method of HttpSecureAppServlet.java [1]:
 throw new ServletException(e.getMessage());
by
 throw new ServletException(e.getCause().getMessage());

[1] https://dev.openbravo.com/websvn/openbravo/trunk/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java [^]
commsup_sprint6
blocks defect 0007113 closed rafaroda SQL error badly informed when printing Jasper Report 
blocks backport 0007305 closed rafaroda Procurement reports do not handle currencies 
Issue History
2009-02-10 12:58rafarodaTypedefect => backport
2009-02-10 12:58rafarodafix_in_branch => 2.40
2009-02-10 12:58rafarodaRelationship addedblocks 0007305
2009-02-12 13:57svnbotCheckin
2009-02-12 13:57svnbotNote Added: 0013410
2009-02-12 13:57svnbotStatusscheduled => resolved
2009-02-12 13:57svnbotResolutionopen => fixed
2009-02-12 13:57svnbotsvn_revision => 13095
2009-02-13 09:18rafarodaTag Attached: commsup_sprint6
2009-02-26 11:28sureshbabuStatusresolved => closed
2009-02-26 11:28sureshbabuNote Added: 0014090
2009-02-26 11:28sureshbabuFixed in Version => trunk

Notes
(0013410)
svnbot   
2009-02-12 13:57   
Repository: openbravo
Revision: 13095
Author: rafaroda
Date: 2009-02-12 13:57:06 +0100 (Thu, 12 Feb 2009)

Fixes bug 0007480 Now SQL errors are correctly informed when printing Jasper Report both in the UI and the log.

---
U branches/r2.40/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=13095&sc=1 [^]
(0014090)
sureshbabu   
2009-02-26 11:28   
Now the error text looks like this..

 There is no conversion rate defined from (EUR-€) to (GBP-£) for date '25-02-2009', Client 'CTS' and Organization 'Pamplona'.

retested in context http://79.125.56.185/openbravotrunk [^]