Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007113Openbravo ERP03. Procurement managementpublic2009-01-23 16:492009-03-03 09:41
alostale 
rafaroda 
highmajoralways
closedfixed 
5
pi 
pi 
Core
No
0007113: 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
depends on backport 0007480 closed rafaroda SQL error badly informed when printing Jasper Report 
png BeforeFix.png (8,240) 2009-02-09 16:16
https://issues.openbravo.com/file_download.php?file_id=819&type=bug
png

png AfterFix.png (7,565) 2009-02-09 16:17
https://issues.openbravo.com/file_download.php?file_id=820&type=bug
png
Issue History
2009-01-23 16:49alostaleNew Issue
2009-01-23 16:49alostaleAssigned To => rafaroda
2009-01-23 16:49alostalesf_bug_id0 => 2531286
2009-01-23 16:49alostaleRegression testing => No
2009-01-23 16:49alostaleIssue Monitored: alostale
2009-01-28 08:45rafarodaversion => trunk
2009-01-30 17:12rafarodaAssigned Torafaroda => Dowid
2009-01-30 17:12rafarodaPrioritynormal => high
2009-01-30 17:12rafarodaStatusnew => scheduled
2009-02-02 06:11pjuvaraPriorityhigh => urgent
2009-02-05 15:50rafarodaRelationship addedblocks 0007395
2009-02-09 15:51rafarodaRelationship deletedblocks 0007395
2009-02-09 16:03rafarodaAssigned ToDowid => rafaroda
2009-02-09 16:03rafarodaPriorityurgent => high
2009-02-09 16:03rafarodaSummaryPurchase Order Report does not work => SQL error badly informed when printing Jasper Report
2009-02-09 16:03rafarodaDescription Updated
2009-02-09 16:03rafarodaProposed Solution updated
2009-02-09 16:03rafarodaSteps to Reproduce Updated
2009-02-09 16:07rafarodaSteps to Reproduce Updated
2009-02-09 16:10rafarodaStatusscheduled => feedback
2009-02-09 16:11rafarodaStatusfeedback => new
2009-02-09 16:11rafarodaSteps to Reproduce Updated
2009-02-09 16:16rafarodaSteps to Reproduce Updated
2009-02-09 16:16rafarodaFile Added: BeforeFix.png
2009-02-09 16:17rafarodaFile Added: AfterFix.png
2009-02-10 12:58rafarodaStatusnew => scheduled
2009-02-10 12:58rafarodafix_in_branch => trunk
2009-02-11 12:52svnbotCheckin
2009-02-11 12:52svnbotNote Added: 0013340
2009-02-11 12:52svnbotStatusscheduled => resolved
2009-02-11 12:52svnbotResolutionopen => fixed
2009-02-11 12:52svnbotsvn_revision => 13047
2009-02-13 09:18rafarodaTag Attached: commsup_sprint6
2009-02-24 10:51alostaleIssue End Monitor: alostale
2009-03-03 09:41sureshbabuStatusresolved => closed
2009-03-03 09:41sureshbabuNote Added: 0014268
2009-03-03 09:41sureshbabuFixed in Version => trunk

Notes
(0013340)
svnbot   
2009-02-11 12:52   
Repository: openbravo
Revision: 13047
Author: rafaroda
Date: 2009-02-11 12:52:52 +0100 (Wed, 11 Feb 2009)

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

---
U trunk/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=13047&sc=1 [^]
(0014268)
sureshbabu   
2009-03-03 09:41   
Retested in context http:79.125.56.185/openbravotrunk