Jump to content
  • JRViewer netscape lockup


    deklotz
    Assigned User teodord
    CategoryBug report
    PriorityHigh
    ReproducibilityAlways
    ResolutionFixed
    SeverityMajor
    StatusClosed

    I'm trying to fix a problem that only occurs when using a mozilla based browser engine, it doesn't occur when using IE. It seems to be related to JRExporter being created over and over again during browser resize events (but again only under netscape/mozilla).

     

    The problem is with the inner class PageRenderer which overides paintComponent() and calls viewer.paintPage(...).

     

    Within paintPage() at line (release 1.2.5) #1583:

     

    JRGraphics2DExporter exporter = new JRGraphics2DExporter();

     

    Causes a lockup / deadlock condition when using a browser mozilla based engine. I can cause this lockup while resizing the browser window. See attachments for the call stack using netbeans.

     

    Here is a patch difference between 1.2.5 and my changes to fix this problem with net.sf.jasperreports.view.JRViewer :

     

    68d67

    < import javax.swing.SwingUtilities;

    350,358d348

    <

    < try

    < {

    < exporter = new JRGraphics2DExporter();

    < }

    < catch (Exception e)

    < {

    < e.printStackTrace ();

    < }

    1592a1583

    > JRGraphics2DExporter exporter = new JRGraphics2DExporter();

    1623,1626c1614

    < synchronized (viewer)

    < {

    < viewer.paintPage((Graphics2D)g.create());

    < }

    ---

    > viewer.paintPage((Graphics2D)g.create());

    1629,1631c1617

    <

    < private JRGraphics2DExporter exporter ;

    <

    ---

    >

     

     

    Let me know what I can do to help or if I can provide any more information.


    Attachments: JRViewer.java

    User Feedback

    Recommended Comments

    Perhaps it would be best if I attach the complete file for reference.

     

    The changes are trivial but I would like comment before submitting a formal patch.

     

    Thanks for your time.

     

    -Dennis Klotz

    Link to comment
    Share on other sites

     

    Hi,

     

    Could you provide more details about the symptoms?

    We\'re talking about the applet viewer, right?

    Does it freeze?

    Can you reproduce this in the supplied /demo/samples/webapp application provided with the project?

     

    Thank you,

    Teodor

     

    Link to comment
    Share on other sites

    I was able to reproduce the problem by making a slight change to viewer.html (found within Jasper1.2.5 Demo Code/samples/webapp)

     

    I changed all of the references of a fixed size for the applet, to 100% for width and height.

     

    Change #1

    if (_ie == true) document.writeln(\'\')

     

    Change #2

     

    I wasn\'t really sure which one was used so I changed both lines.

     

    Next run the embedded applet viewer within a Mozilla based browser and resize the browser. You will see that the browser hangs.

     

    As I\'ve stated within this post, the real problem seems to be with the line :

     

    JRGraphics2DExporter exporter = new JRGraphics2DExporter();

     

    being executed over and over again during the painting events. My fix moves the creation of the object to initialization time and it appears to fix the problem.

     

    Please let me know what else I can provide to help.

     

    -Dennis Klotz

     

    Link to comment
    Share on other sites

    I just noticed that I still have the synchronized (viewer) in the example code. That should be removed. The important change is moving the line:

     

    JRGraphics2DExporter exporter = new JRGraphics2DExporter();

     

    from the method paintPage(Graphics2D grx).

    Link to comment
    Share on other sites


×
×
  • Create New...