Jump to content

JasperFillManager.fillReport hangs (3.7.2)


kvasov

Recommended Posts

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

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

  • 6 months later...

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.jar

log4j-1.2.14.jar

The 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

  • 8 months later...

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

  • 9 months later...

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: exception
java.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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...