Closed nickvl closed 3 years ago
I have the same issue. I tried with the following piece of code and I get the NullPointerException at the last line.
JRSwapFile swapFile = new JRSwapFile(this.baseFolder.getAbsolutePath(), 1024, 1024);
JRVirtualizer virtualizer = new JRSwapFileVirtualizer(10, swapFile);
JRVirtualizationHelper.setThreadVirtualizer(virtualizer);
JasperPrint jasperPrint = JasperFillManager.fillReport(compiledReportFile.getAbsolutePath(), reportParametersValuesTmp, conn);
JRSaver.saveObject(jasperPrint, filledReportFile.getAbsolutePath());
JasperPrint JasperPrintReloaded = JRLoader.loadJasperPrintFromFile(filledReportFile.getAbsolutePath(), virtualizer);
It seems that in the loader the original JRVirtualizationContext is lost.
It seem that the issue is related with the number of element in the JasperPrint object: with a small number of elements (probably utill they fit in one virtual page) the issue do not happen.
The issue is present starting from version 6.12.x; in version 6.11.0 the above code works perfectly.
Jasper library: 6.15.0 A Critical problem with some reports during a try to read existing jasper print:
it happens because it sees null cachedTemplates during invocation GetField fields = in.readFields(); in JRVirtualizationContext
This issue does not exist in jasper library 6.7.0