Results 1 to 5 of 5

Thread: Jasper Reports Thread Interruption

  1. #1
    Join Date
    Sep 2004
    Location
    Dallas
    Posts
    4

    Default Jasper Reports Thread Interruption

    Hi,
    I have a problem relate to jasper report, i have tried some solutions but i 'm still not solve this problem.
    It's a web application, i used Jboss 3.2.3, tomcat 5.0 integrate in jboss. In EJBs, first i call to DAO layer to get datasource, parameters.
    then i call to jasper report function: JasperFillManager.fillReportToStream(jasperreport, outputstream, parameters, datasource),
    If the data source is small, the method call is ok. But with huge datasource, i am seeing this problem of Thread Interruption.
    "The report filling thread was interrupted"!!!
    ---------------------------------------------------------------------------------------
    I just do not understand why the Thread was interrupted and by whom…” is it by the container “ . To give you more context, the jasper code was invoked within a stateless session bean and that bean has transaction timout set to 600. Does the Container managed transaction timeout has anything to do with this Thread Interruption ? . My initial guess is not...maybe i might be wrong.
    -----------------------------------------------------------------------------------------
    I open source code code of jasper report, i I that the thread generate report was interrupted at statement:
    "if (Thread.currentThread().isInterrupted())
    {
    throw new JRException("Current thread interrupted.");
    }
    "
    Have you had experience with this problem? Could you share with me? Why we have to check the thread by statements: "Thread.currentThread().isInterrupted()"?

    Pls see the printstackstrace for details.

    19:58:20,311 ERROR [STDERR] dori.jasper.engine.JRException: The report filling t
    hread was interrupted.
    19:58:20,311 ERROR [STDERR] at dori.jasper.engine.fill.JRFiller.fillReport(J
    RFiller.java:163)
    19:58:20,311 ERROR [STDERR] at dori.jasper.engine.JasperFillManager.fillRepo
    rt(JasperFillManager.java:350)
    19:58:20,311 ERROR [STDERR] at dori.jasper.engine.JasperFillManager.fillRepo
    rtToFile(JasperFillManager.java:271)
    19:58:20,311 ERROR [STDERR] at dori.jasper.engine.JasperFillManager.fillRepo
    rtToFile(JasperFillManager.java:257)
    19:58:20,311 ERROR [STDERR] at com.dlv.inmpp.system.ReportManager.generateRe
    port(ReportManager.java:56)
    19:58:20,311 ERROR [STDERR] at com.dlv.inmpp.online.ejb.rpt.RAEJB.ra002a(RAE
    JB.java:3453)
    19:58:20,311 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(
    Native Method)
    19:58:20,311 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(N
    ativeMethodAccessorImpl.java:39)
    19:58:20,311 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
    ke(DelegatingMethodAccessorImpl.java:25)
    19:58:20,311 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
    24)
    19:58:20,311 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$Conta
    inerInterceptor.invoke(Stateles...

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    I would guess that the thread is being interrupted by JBoss given that the EJB specification explicitly states that an EJB can't spawn its own threads, which is effectively happening here when using JasperReports.

    Try testing the code outside of an EJB, perhaps in a servlet, to see if you get the same error.

    You should consider moving this out of an EJB since I don't think you can guarantee how this will run in any container. I am sure some containers will fare better than others, but the fact is containers are working to a spec that is forbidding EJBs from creating threads.

    Rob

  3. #3
    Join Date
    Sep 2004
    Location
    Dallas
    Posts
    4

    Default Does JasperFillManager.fillReportToStream() create a new Thr

    Thanks for the reply and actually i have a basic question.

    Does this following method in Jasper actually create a new thread ?

    JasperFillManager.fillReportToStream(jasperreport, outputstream, parameters, datasource),

  4. #4
    Join Date
    Aug 2004
    Location
    Tacoma, WA USA
    Posts
    49

    Default

    I think that's what robh was saying...
    ElPapa

    The delusion that people care about what I think:
    http://www.codethought.com/blog

  5. #5
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Actually, I am not entirely sure what it does. I know there is some thread signalling going on, but I haven't looked in detail to see what is happening. I suggest posting this on the JR mailing list.

    Rob

Similar Threads

  1. Jasper Reports and Rich client
    By afida in forum Swing
    Replies: 20
    Last Post: Jul 22nd, 2010, 06:51 AM
  2. Replies: 1
    Last Post: Sep 7th, 2005, 07:00 AM
  3. Replies: 1
    Last Post: Apr 10th, 2005, 01:26 PM
  4. Sessions closing after commit
    By bendg25 in forum Data
    Replies: 0
    Last Post: Mar 21st, 2005, 04:38 AM
  5. Replies: 2
    Last Post: Oct 3rd, 2004, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •