Hello,
I've a problem when I stop the server. I use jasperreport 6.0.0, tomcat 7.0.55.
When I stop the server I've this stacktrace :
febr. 12, 2015 2:31:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksGrave: The web application [/mywebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@38a9bc80]) and a value of type [java.lang.Class] (value [class plantime_report46jrxml_1423747396799_660787]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.febr. 12, 2015 2:31:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaksGrave: The web application [/mywebapp] created a ThreadLocal with key of type [net.sf.jasperreports.engine.fonts.FontUtil$1] (value [net.sf.jasperreports.engine.fonts.FontUtil$1@7cd7650f]) and a value of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Here you can find the code :
String reportPath = configurationService.getProperty("report.path");String reportName = configurationService.getProperty("report.pdf");if(!type) { reportName = configurationService.getProperty("report.xls");} File reportFile = new File(reportPath, reportName);File reportCompiledFile = new File(reportPath, reportName + ".jasper"); if (!reportCompiledFile.exists() || reportFile.lastModified() > reportCompiledFile.lastModified()){ JasperDesign design = JRXmlLoader.load(reportFile); JasperCompileManager.compileReportToFile(design, reportCompiledFile.getAbsolutePath());} JasperReport report = (JasperReport) JRLoader.loadObject(reportCompiledFile); Driver driver = new Driver();DriverManager.registerDriver(driver);String url = configurationService.getProperty("dataSource.url");String login = configurationService.getProperty("dataSource.username");String pswd = configurationService.getProperty("dataSource.password");Connection con = (Connection) DriverManager.getConnection(url,login, pswd); JasperPrint print = JasperFillManager.fillReport(report, parameters, con); String fileName = parameters.get("lastName") + "-" + FormatUtils.FORMAT_DMYHMS.format(new Date());if(type) { fileName = fileName + ".pdf"; JasperExportManager.exportReportToPdfFile(print, dest.getAbsolutePath()+"\\"+fileName);} else { fileName = fileName + ".xls"; JRXlsExporter exporter = new JRXlsExporter(); exporter.setExporterInput(new SimpleExporterInput(print)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(dest.getAbsoluteFile() + "\\" + fileName)); SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration(); configuration.setOnePagePerSheet(false); configuration.setDetectCellType(true); configuration.setCollapseRowSpan(true); exporter.setConfiguration(configuration); exporter.exportReport();} con.close();
The reports are generated in pdf or XLS. It's work fine. How can I removed the problem whith the memory leak ?
Can anyone help pls to solve this issue.
Thank you all in anticippation.
0 Answers:
No answers yet
Excatly the same issue in 6.7.0. Is there a soultion?
Excatly the same issue . Is there a soultion?