kvasov Posted July 5, 2010 Share Posted July 5, 2010 Hi,I've got a problem with JasperFillManager. it hangs after several invocations of fillReport method. I'm not doing anything complex. it's a simple one-page report where around 15 parameters are passed as a HashMap. that's how I create jaspre report: try { resourceAsStream = MarginCallManager.class.getClassLoader().getResourceAsStream("report.jrxml"); jr = JasperCompileManager.compileReport(resourceAsStream); LOG.info("compiled report for jasper"); } catch(JRException e) { LOG.error("failed to load jasper report", e); } finally { try { if(resourceAsStream != null) { resourceAsStream.close(); } } catch (Exception e) { LOG.warn("failed to close report stream for jasper", e); } } so this instance is shared for all invocations. this is how I fill report and create a PDF: try { Map<String, String> values = new HashMap<String, String>(); ... ByteArrayOutputStream os = new ByteArrayOutputStream(); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, values, new JREmptyDataSource()); LOG.info("filled report for jasper"); JasperExportManager.exportReportToPdfStream(jasperPrint, os); LOG.info("created pdf for Id=" + Id); return os.toByteArray(); } catch (JRException e) { LOG.error("error creating pdf file for " + marginCallId, e); } catch (Exception e) { LOG.error("unknown error loading margin call for " + marginCallId, e); } I'm using jasper reports version 3.7.2 and it's running under Tomcat6. Calls to create a PDF report are actually RMI calls. After several calls it hangs in JasperFillManager.fillReport method and after that no reports are created. It just stops working. It happens under really light load, like 1 invocation per hour. It's quite frustrating as there are no exceptions, no signs of failure, it just hangs.I'd really appreciate any advice or help.Initially I was creating JasperReport instance for each invocation but had the same problem. Thanks,Vladimir Link to comment Share on other sites More sharing options...
lucianc Posted July 5, 2010 Share Posted July 5, 2010 Try to enable debug logging for JasperReports (e.g. with log4j) and see whether anything relevant shows in the log file at the time of the problem.Regards,Lucian Link to comment Share on other sites More sharing options...
kvasov Posted July 6, 2010 Author Share Posted July 6, 2010 Hi Lucian, thank you for the hint. I'll try changing log4j level. Unfortunately can't do it now as the environment where this problem occurs is now closed for changes. Regards, Vladimir Link to comment Share on other sites More sharing options...
tsunami Posted January 26, 2011 Share Posted January 26, 2011 I had the same problem. After reviewing my code and my report I didn't find anything. However, after checking the dependecies I found that I had two log4j jars:log4j-1.2.12.jarlog4j-1.2.14.jarThe one producing the situation is log4j-1.2.12.jar, so check your dependecies and remove the log4j-1.2.12.jar one.Hope it helps. Link to comment Share on other sites More sharing options...
kvasov Posted January 26, 2011 Author Share Posted January 26, 2011 Hi Tsunami,thanks for suggestion - I checked dependecy tree - we use log4j 1.2.15 (plus sl4j and log4j extras)btw we moved to another reporting library since then. Regards,Vladimir Link to comment Share on other sites More sharing options...
ghitsman Posted September 29, 2011 Share Posted September 29, 2011 Hello,First of all i'm sorry for my english.I have the same problem, please let me know if you solve this.Thanks you!... Link to comment Share on other sites More sharing options...
kvasov Posted October 7, 2011 Author Share Posted October 7, 2011 Hi Ghitman,No, unfortunately I didn't have enough time to work on mysteries like this one, so we decided to use BFO to generate PDF reports. Which is a shame as I had good experience with Jasper reports in the past. thanks Vladimir Link to comment Share on other sites More sharing options...
selvababuu Posted October 7, 2011 Share Posted October 7, 2011 Hi,I have a similar problem and i've posted it as follows "jasperFillManager.fillreport cannot hold huge data coming from a hash map"Please guide me to solve this issue.Thank you Link to comment Share on other sites More sharing options...
devisuni Posted July 18, 2012 Share Posted July 18, 2012 Hi , i am also facing similar kind of issue .I am using subreports in my report . my application got structed off while filling the report in PDF .and it is throwing the Invocation TargetException. Here is the Exception. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.swixml.XAction.actionPerformed(XAction.java:103) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$000(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)Caused by: java.lang.NoClassDefFoundError: RobotReport_Table32Dataset322_1342266512323_770642 (wrong name: RobotReport_1342266512323_770642) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at net.sf.jasperreports.engine.util.JRClassLoader.loadClass(JRClassLoader.java:338) at net.sf.jasperreports.engine.util.JRClassLoader.loadClassFromBytes(JRClassLoader.java:261) at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaCompiler.java:88) at net.sf.jasperreports.engine.design.JRAbstractCompiler.loadEvaluator(JRAbstractCompiler.java:320) at net.sf.jasperreports.engine.JasperCompileManager.loadEvaluator(JasperCompileManager.java:237) at net.sf.jasperreports.engine.JasperCompileManager.loadEvaluator(JasperCompileManager.java:257) at net.sf.jasperreports.engine.fill.JRFillSubreport.createEvaluator(JRFillSubreport.java:411) at net.sf.jasperreports.components.table.fill.FillTableSubreport.createEvaluator(FillTableSubreport.java:79) at net.sf.jasperreports.engine.fill.JRFillSubreport.loadReportEvaluator(JRFillSubreport.java:399) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:368) at net.sf.jasperreports.components.table.fill.FillTableSubreport.evaluateSubreport(FillTableSubreport.java:95) at net.sf.jasperreports.components.table.fill.FillTable.evaluate(FillTable.java:102) at net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:88) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:257) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:473) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:434) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnHeader(JRVerticalFiller.java:479) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBreak(JRVerticalFiller.java:1920) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBreak(JRVerticalFiller.java:1945) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2053) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooter(JRVerticalFiller.java:920) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooters(JRVerticalFiller.java:786) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:294) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at fillReport ... 41 more JRThreadSubreportRunner [ERROR] [TestReport.sub.ReportConventions subreport filler] Fill 21: exceptionjava.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:503) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.suspend(JRThreadSubreportRunner.java:185) at net.sf.jasperreports.engine.fill.JRBaseFiller.suspendSubreportRunner(JRBaseFiller.java:1829) at net.sf.jasperreports.engine.fill.JRVerticalFiller.addPage(JRVerticalFiller.java:1833) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBreak(JRVerticalFiller.java:1916) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBreak(JRVerticalFiller.java:1945) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2053) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:285) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:132) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:640) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205) at java.lang.Thread.run(Unknown Source)I got Strucked in this problem . can anybody help me on this problem .Thanks for any Help !!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now