Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0047943 | Openbravo ERP | B. User interface | public | 2021-10-27 15:27 | 2022-12-14 12:54 |
|
Reporter | lbressan | |
Assigned To | lbressan | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | |
Platform | | OS | 5 | OS Version | |
Product Version | pi | |
Target Version | | Fixed in Version | | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | 2021-11-08 |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0047943: Reports that contain images stop working after upgrading from 18Q3 to 21Q2.3 |
Description | No images are printed on subreports
Here I leave the error that throws by log:
Caused by: java.sql.SQLException: PooledConnection has already been closed.
at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:87) ~[tomcat-jdbc.jar:?]
at com.sun.proxy.$Proxy57.prepareStatement(Unknown Source) ~[?:?]
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:267) ~[jasperreports-6.0.0.jar:6.0.0]
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:196) ~[jasperreports-6.0.0.jar:6.0.0]
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1119) ~[jasperreports-6.0.0.jar:6.0.0] |
Steps To Reproduce | 1) Go to the sale "Sales Order"
2) Select an Order and modify it in JasperSoft
3) Add an image in the subreport in Jaspersoft
4) Try to print the report again in Backoffice
5) It may be observed that the report with the added image is not printed |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2021-10-27 15:27 | lbressan | New Issue | |
2021-10-27 15:27 | lbressan | Assigned To | => platform |
2021-10-27 15:27 | lbressan | Modules | => Core |
2021-10-27 15:27 | lbressan | Regression date | => 2021-11-08 |
2021-10-27 15:27 | lbressan | Triggers an Emergency Pack | => No |
2021-10-29 13:12 | AugustoMauch | Note Added: 0132758 | |
2021-10-29 13:12 | AugustoMauch | Assigned To | platform => lbressan |
2021-10-29 13:12 | AugustoMauch | Status | new => feedback |
2021-10-29 13:12 | AugustoMauch | Summary | Reports stop working after upgrading from 18Q3 to 21Q2.3 => Reports with images stop working after upgrading from 18Q3 to 21Q2.3 |
2021-10-29 13:12 | AugustoMauch | Summary | Reports with images stop working after upgrading from 18Q3 to 21Q2.3 => Reports that contain images stop working after upgrading from 18Q3 to 21Q2.3 |
2021-11-01 15:21 | lbressan | Note Added: 0132768 | |
2021-11-17 14:18 | dromero | Note Added: 0133152 | |
2021-11-24 16:45 | dromero | Note Added: 0133330 | |
2021-11-25 17:18 | cberner | Note Added: 0133374 | |
2021-11-25 17:20 | cberner | Note Edited: 0133374 | bug_revision_view_page.php?bugnote_id=0133374#r23362 |
2022-12-14 12:54 | AugustoMauch | Note Added: 0144672 | |
2022-12-14 12:54 | AugustoMauch | Status | feedback => closed |
2022-12-14 12:54 | AugustoMauch | Resolution | open => unable to reproduce |
Notes |
|
|
Hello Lucía,
Can you please attach the modified report that you used to reproduce the issue? |
|
|
|
Hi Augusto,
The client has modified two things, here I attach:
He comentado una linea y añadido otra linea a la clase org.openbravo.client.application.report.ReportFiller que contiene el método:
JasperPrint fillReport() throws JRException {
JasperPrint jasperPrint;
long t1 = System.currentTimeMillis();
if (connectionProvider == null) {
// jasperPrint = fill(OBDal.getReadOnlyInstance().getConnection()); -> Esto es lo que hay y lo he comentado y he añadido la clase siguiente y ha funcionado en varios procesos.
jasperPrint = fill(OBDal.getInstance().getConnection());
} else {
jasperPrint = fill();
}
log.debug("Report {} filled in {} ms", jasperReport.getName(),
(System.currentTimeMillis() - t1));
return jasperPrint;
}
El cambio basicamente ha sido pasar de OBDal.getReadOnlyInstance().getConnection() a OBDal.getInstance().getConnection() y ha funcionado en 2 de los 3 reports que estaban dando error.
He has also modified the core:
Fichero org.openbravo.client.application.report.ReportFiller
-> Hemos dejado así el método fillReport()
JasperPrint fillReport() throws JRException {
JasperPrint jasperPrint;
long t1 = System.currentTimeMillis();
if (connectionProvider == null) {
//Inicio Cambio
// jasperPrint = fill(OBDal.getReadOnlyInstance().getConnection());
jasperPrint = fill(OBDal.getInstance().getConnection());
//Fin Cambio
} else {
jasperPrint = fill();
}
log.debug("Report {} filled in {} ms", jasperReport.getName(),
(System.currentTimeMillis() - t1));
return jasperPrint;
}
· Fichero org.openbravo.erpCommon.utility.Utility
Hemos dejado así el método showImageLogo
public static BufferedImage showImageLogo(String logo, String org) throws IOException {
// Same as showImage(id), using getImageLogo(id, org, true) to close the DAL connection once the
// image has been retrieved.
// This is required to avoid connection leaks when invoking this method from a sub-report.
// This is needed until issue https://issues.openbravo.com/view.php?id=30182 [^] is fixed.
//Inicio cambio EXOS
// return ImageIO.read(new ByteArrayInputStream(getImageLogo(logo, org, true)));
return ImageIO.read(new ByteArrayInputStream(getImageLogo(logo, org, false)));
//Fin cambio EXOS
}
También aquí cambiamos la función getImageLogoObject añadiendo un else-if más
//Cambio EXOS
else if ("jover-logo".equals(logo)) {
if (org != null && !org.equals("")) {
Organization organization = OBDal.getReadOnlyInstance().get(Organization.class, org);
img = organization.getObmdImage(); //campo nuevo donde almacenamos una nueva imagen para la org.
}
}
Y por último modificamos la parte del jrxml donde se llama a la función de la imagen para realizar esta llamada
org.openbravo.erpCommon.utility.Utility.showImageLogo("jover-logo", $F{organizationid}) |
|
|
(0133152)
|
dromero
|
2021-11-17 14:18
|
|
|
|
(0133330)
|
dromero
|
2021-11-24 16:45
|
|
|
|
(0133374)
|
cberner
|
2021-11-25 17:18
(edited on: 2021-11-25 17:20) |
|
Hello, I've been trying to reproduce this issue, but I was not able to do it.
I've tested with this C_OrderLinesJR_new.jrxml modified file: https://gitlab.com/-/snippets/2212176 [^] , it only adds a new image at the end, using showImageLogo API.
This seems to work fine on both reports and subreports. I didn't apply the modifications that were mentioned in the previous note(these are customer customizations and shouldn't be necessary to fix the repo).
Could you provide a report that fails so we can reproduce the issue? The one I prepared with an image works perfectly fine.
I've tested both in 21Q2.3 and in master, in both it seems to work correctly.
|
|
|
|
Closing this issue after 1 year of inactivity |
|