Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0047943
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] B. User interfacemajoralways2021-10-27 15:272022-12-14 12:54
ReporterlbressanView Statuspublic 
Assigned Tolbressan 
PrioritynormalResolutionunable to reproduceFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date2021-11-08
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0047943: Reports that contain images stop working after upgrading from 18Q3 to 21Q2.3

DescriptionNo 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 Reproduce1) 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
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0132758)
AugustoMauch (administrator)
2021-10-29 13:12

Hello Lucía,

Can you please attach the modified report that you used to reproduce the issue?
(0132768)
lbressan (developer)
2021-11-01 15:21

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 (reporter)
2021-11-17 14:18

any update?
(0133330)
dromero (reporter)
2021-11-24 16:45

any update?
(0133374)
cberner (developer)
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.

(0144672)
AugustoMauch (administrator)
2022-12-14 12:54

Closing this issue after 1 year of inactivity

- 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 View Revisions
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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker